为什么:System.IO.FileLoadException: Access is denied
我做的一个Web站点,在本地机器上测试时没有任何问题,但是当我把它放到web服务器上时,页面就会出错,出现以下提示:
==============================================
Access is denied: 'CommonGlobal.CommonUtility'.
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: 'CommonGlobal.CommonUtility'.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Assembly Load Trace: The following information can be helpful to determine why the assembly 'CommonGlobal.CommonUtility' could not be loaded.
=== Pre-bind state information ===
LOG: DisplayName = CommonGlobal.CommonUtility, Version=1.0.1528.20259, Culture=neutral, PublicKeyToken=35a3f5a78c29cae6
(Fully-specified)
LOG: Appbase = file:///E:/web/safa/DCenter
LOG: Initial PrivatePath = bin
Calling assembly : DCenter.Web, Version=1.0.1528.22535, Culture=neutral, PublicKeyToken=null.
===
LOG: Attempting download of new URL file:///C:/WINNT/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET Files/dcenter/f47a8152/51b7ca04/CommonGlobal.CommonUtility.DLL.
LOG: Attempting download of new URL file:///C:/WINNT/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET Files/dcenter/f47a8152/51b7ca04/CommonGlobal.CommonUtility/CommonGlobal.CommonUtility.DLL.
LOG: Attempting download of new URL file:///E:/web/safa/DCenter/bin/CommonGlobal.CommonUtility.DLL.
================================================
我在项目中引用了一个CommonGlobal.CommonUtility.dll,其中定义了几个静态函数而已。出错后我在本地重新编译了一遍,上船覆盖后显示正常,但当我改变web.config之后,这个错误又出现了。之后试过几次,发现只要重新编译一次就正常,可是一旦改变了web.config文件,就又会出现这种错误了。
请问这是什么问题?