Last post Aug 03, 2007 03:31 AM by Rex Lin - MSFT
Jul 30, 2007 04:02 PM|IMarshal|LINK
Would appreciate ideas on how to attack an ASP.Net 'Access is denied' exception. I am not entirely sure the cause of the issue. The entire exception message is displayed at the bottom of this message.
I don't understand how it can be reporting an error on loading the ICSharpCode.SharpZipLib.DLL. The error is encountered on my development system and the production server.
Server Error in '/MyApp' Application.
Access is denied: 'ICSharpCode.SharpZipLib'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.IO.FileLoadException: Access is denied: 'ICSharpCode.SharpZipLib'.
Line 4412: System.GC.Collect();
Line 4414: document.Close();
Line 4416: Response.ContentType="application/pdf";
Source File: C:\Projects\MyProjects\MyDept\MyApp\Contracts\ContractPDF.aspx.cs Line: 4414
Assembly Load Trace: The following information can be helpful to determine why the assembly 'ICSharpCode.SharpZipLib' could not be loaded.
=== Pre-bind state information ===
LOG: DisplayName = ICSharpCode.SharpZipLib, Version=0.5.0.0, Culture=neutral, PublicKeyToken=1b03e6acf1164f73
LOG: Appbase = file:///C:/Projects/MyProjects/MyDept/MyApp
LOG: Initial PrivatePath = bin
Calling assembly : itextsharp, Version=18.104.22.168, Culture=neutral, PublicKeyToken=null.
LOG: Attempting download of new URL file:///C:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET Files/MyApp/8319a2aa/a5e76b9d/ICSharpCode.SharpZipLib.DLL.
LOG: Attempting download of new URL file:///C:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET Files/MyApp/8319a2aa/a5e76b9d/ICSharpCode.SharpZipLib/ICSharpCode.SharpZipLib.DLL.
LOG: Attempting download of new URL file:///C:/Projects/MyProjects/MyDept/MyApp/bin/ICSharpCode.SharpZipLib.DLL.
[FileLoadException: Access is denied: 'ICSharpCode.SharpZipLib'.]
MyDept.Contracts.ContractPDF.Page_Load(Object sender, EventArgs e) in C:\Projects\MyProjects\MyDept\MyApp\Contracts\ContractPDF.aspx.cs:4414
System.Web.UI.Control.OnLoad(EventArgs e) +67
Version Information: Microsoft .NET Framework Version:1.1.4322.2407; ASP.NET Version:1.1.4322.2407
Access is denied
Aug 01, 2007 05:58 AM|Rex Lin - MSFT|LINK
This behaviour is by design. Check this out
Your immediate way out of the problem is either:
> If you have physical access to the server then Register the assembly in the GAC using GACUTIL.EXE or copy the file into %win32root%\assembly using Windows explorer.
If you only have remote access such as ftp which is what hosting with an ISP would provide you then you have no choice but to Remove the strong naming from the assembly, if you don't have access to GAC you should just recompiled the SharZipLib without the
Hope that helps
Aug 03, 2007 03:31 AM|Rex Lin - MSFT|LINK
We are marking this issue as "Answered". If you have any new findings or concerns, please feel free to unmark the issue.
Thank you for your understanding!