Thursday, December 07, 2006

ASP.NET "Access Denied Error"

Have you ever received an error like this:

Server Error in '/MyWebApp' Application
Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request.
Please review the specific error details below and modify your configuration file appropriately.

Parser Error Message: Access is denied: 'mydll'.

Source Error:

Line 169: <add assembly=<System.Drawing, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a>/>
Line 170: <add assembly=<System.EnterpriseServices, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a>/>
Line 171: <add assembly=<*>/>
Line 172: </assemblies>

Source File: c:\winnt\\framework\v1.0.3705\Config\machine.config Line: 171
Version Information: Microsoft .NET Framework Version:1.0.3705.0; ASP.NET Version:1.0.3705.0
If so, then you are most likely suffering from a locking issue. It seems that the Microsoft Windows Indexing Service will lock a file while its indexing it and if a page is requested during that time, it will toss an error similar to the one above. Why it does this, I don't know.

There are several ways to address this issue
  1. Disable Indexing services. Often Indexing Services is not needed on most services unless your using it for your search engine, in which case, I would just suggest using google instead. In order to disable Indexing services, open up the Control Panel, click Add/Remove Programs, click Windows Components, and uncheck Indexing Services.
  2. You can also disable it on a given drive by opening My Computer, right clicking the drive, click properties, and uncheck "Allow Indexing Service to index this disk for fast file searching".
  3. You can do the same for a folder or for a given file. Right click on the folder or file, click properties, click the Advanced button on the General tab, and uncheck the item that starts with "For fast searching, allow Indexing Service to index this (file|folder)."
  4. Finally, if you really must have Index Services running, you can solve the problem by just removing the indexing from the "c:\\Microsoft.NET\Framework\\Temporary ASP.NET Files" folder. WINDIR is, of course, your installed windows directory, Version is the version of .NET that your application is using. I suggest just not indexing the Microsoft.NET folder at all, why would you be searching that folder in the first place
If you want to read more about this, reference the MSDN article (#329065) via the following url:;en-us;329065

No comments: