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.
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'.
Source Error:
Line 4412: System.GC.Collect();
Line 4413:
Line 4414: document.Close();
Line 4415:
Line 4416: Response.ContentType="application/pdf";
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.
Stack Trace:
[FileLoadException: Access is denied: 'ICSharpCode.SharpZipLib'.]
iTextSharp.text.pdf.PdfDocument.Close()
iTextSharp.text.Document.Close()
MyDept.Contracts.ContractPDF.Page_Load(Object sender, EventArgs e) in C:\Projects\MyProjects\MyDept\MyApp\Contracts\ContractPDF.aspx.cs:4414
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.
Or
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
strong name
Hope that helps
Best Regards,
__________________________________________________
Sincerely,
Rex Lin
Microsoft Online Community Support
If there is any question or the issue is not resolved, please feel free to mark the thread as not resolved
Marked as answer by Rex Lin - MSFT on Aug 03, 2007 03:31 AM
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!
Best Regards,
__________________________________________________
Sincerely,
Rex Lin
Microsoft Online Community Support
If there is any question or the issue is not resolved, please feel free to mark the thread as not resolved
IMarshal
0 Points
6 Posts
Exception on loading an external COM DLL
Jul 30, 2007 04:02 PM|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.
Thank you.
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'.
Source Error:
Line 4412: System.GC.Collect();
Line 4413:
Line 4414: document.Close();
Line 4415:
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
(Fully-specified)
LOG: Appbase = file:///C:/Projects/MyProjects/MyDept/MyApp
LOG: Initial PrivatePath = bin
Calling assembly : itextsharp, Version=1.0.4.0, 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.
Stack Trace:
[FileLoadException: Access is denied: 'ICSharpCode.SharpZipLib'.]
iTextSharp.text.pdf.PdfDocument.Close()
iTextSharp.text.Document.Close()
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
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +739
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.2407; ASP.NET Version:1.1.4322.2407
Access is denied
Rex Lin - MS...
All-Star
17422 Points
2116 Posts
Re: Exception on loading an external COM DLL
Aug 01, 2007 05:58 AM|LINK
HI, IMarshal:
This behaviour is by design. Check this out
http://support.microsoft.com/default...en-us%3b813833
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.
Or
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 strong name
Hope that helps
__________________________________________________
Sincerely,
Rex Lin
Microsoft Online Community Support
If there is any question or the issue is not resolved, please feel free to mark the thread as not resolved
Rex Lin - MS...
All-Star
17422 Points
2116 Posts
Re: Exception on loading an external COM DLL
Aug 03, 2007 03:31 AM|LINK
HI, IMarshal:
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!
__________________________________________________
Sincerely,
Rex Lin
Microsoft Online Community Support
If there is any question or the issue is not resolved, please feel free to mark the thread as not resolved