System.IO.FileLoadException:无法加载文件或程序集

时间:2013-04-11 16:55:24

标签: c# asp.net .net-assembly

尝试执行我的Web应用程序时,会引发以下错误。
它说Matrix.Data.dll无法加载。我试图重建程序集并再次引用它。但没用。
另外,它显示警告'程序集绑定日志已关闭',以及与程序集绑定失败日志记录相关的性能损失是什么......?

详细错误:

System.IO.FileLoadException: Could not load file or assembly 'Matrix.Data, Version=5.0.3.16, 
Culture=neutral, PublicKeyToken=ed19106b2f44b5a8' or one of its dependencies. 
The located assembly's manifest definition does not match the assembly reference. 
(Exception from HRESULT: 0x80131040)

File name: 'Matrix.Data, Version=5.0.3.16, Culture=neutral, 
PublicKeyToken=ed19106b2f44b5a8'
at Matrix.Administration._Administration.DoRequest(Boolean& plReplacePlaceholders)
at Matrix.AppServerHTTPHandler.doRequestDefault()
 in D:\FX\AppServer\Appserver.vb:line 443
at AppServer.AppServerHTTPHandler.doRequest(Kernel pKernel) 
in D:\FX\AppServer\Appserver.vb:line 373
at AppServer.AppServerHTTPHandler.processRequest(HttpContext context) 
in D:\FX\AppServer\Appserver.vb:line 107

WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value
 [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated 
with assembly bind failure logging.
To turn this feature off, remove the registry value 
[HKLM\Software\Microsoft\Fusion!EnableLog].

1 个答案:

答案 0 :(得分:1)

您的Accessibility.dll很可能已损坏。即使是管理员,您也无法删除该文件。

您必须进入安全设置并将所有者从TrustedInstaller更改为其他用户,并授予您自己对该文件的权限。完成后,从正在运行的计算机上获取Accessibility.dll并替换损坏的版本。

最好我能猜到,来自Microsoft的安装程序损坏了DLL,因为没有用户有权编辑/删除/替换TrustedInstaller拥有的文件。