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" (http://zedgraph.org/) 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:

    Code:
    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.

    Thanks,

    Eli
     
    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:

    http://www.codeproject.com/KB/web-image/ZedGraphWebAp1.aspx

    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

    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:
    http://stackoverflow.com/questions/1109955/task-failed-because-al-exe-was-not-found

    SignTool.exe not found
    http://social.msdn.microsoft.com/Fo...b/thread/5584cd6a-700e-4c34-bb3d-7a97518fc32a

    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.

    http://www.microsoft.com/downloads/...df-a74f-4207-8586-711ebe331cdc&displaylang=en

    Explanation here:
    http://geekswithblogs.net/Ahmed_Hussein_blog/archive/2009/04/25/al.exe.aspx

    Thanks for your help.
     

Share This Page