Cannot Write Files On WinHost?

Discussion in 'General troubleshooting' started by dyslexicanaboko, Oct 20, 2010.

  1. I tried searching the Forum and the KB for the following issue, but I couldn't find anything. If there is a post on it already, then sorry in advance for double posting. Anyhow, on to the problem:

    I am using an assembly called "Zed Graph" ( which generates graphs based on the data that is provided to it. At one point during its process, it writes a physical image file (*.png) to disk in a specific directory. I tried this out on my local machine and no surprise it works there because I own the machine. However when I published my site to Winhost and tried the same page I got the following error:

    System.Security.SecurityException: That assembly does not allow partially trusted callers. 
    at ZedGraph.Web.ZedGraphWeb.CreateGraph(Stream OutputStream, ImageFormat Format, Boolean bShowTransparency) 
    at ZedGraph.Web.ZedGraphWeb.Render(HtmlTextWriter output) The action that failed was: LinkDemand The Zone of the assembly that failed was: MyComputer
    This basically means to me that the assembly was not allowed to write its image file to the disk. Is there any work around here or is this just not allowed? If it isn't allowed anyone have any bright ideas :D?

    Just wondering.


    Last edited by a moderator: Oct 14, 2015
  2. I haven't found a solution yet, but so far this is what I did find:

    Apparently I am not the only one with this problem, this has to deal with IIS and trust levels, medium trust levels in this case. I am testing out some different things, but I figured I should post about it just in case someone has already dealt with this issue.
  3. Ray


    Last edited by a moderator: Oct 14, 2015
  4. Excellent! Your answer made my day. That worked very well. I am very sure that there is a slight problem with setting the trust to Full, but right now this is making my site work. Thank you very much I do appreciate it.

    Something I found along the way that seems to be very central and important for fixing a lot of Visual Studio problems is this:

    Not being able to find AL.exe:

    SignTool.exe not found

    Fixing those two problems is apparently deeply linked to this install:

    Windows SDK for Windows Server 2008 and .NET Framework 3.5, it is slightly huge (1.3GB ISO). I haven't used it yet, but apparently it does fix a bunch of issues.

    Explanation here:

    Thanks for your help.

Share This Page