强制命名的程序集需要在绑定时找不到偶发文件

时间:2013-02-04 15:07:55

标签: asp.net iis-7 .net-assembly strongname fusion

我们的asp.net Web服务器偶尔会出现绑定问题,导致页面无法显示给最终用户。按刷新通常有效。

如果您查看事件日志,则会收到以下条目:

Exception information: 
    Exception type: FileLoadException 
    Exception message: A strongly-named assembly is required. (Exception from HRESULT:     0x80131044) 

我们的程序集确实有一个强大的名称,但是鉴于这种情况有99.9%的时间我认为这不是问题所在。我打开了融合绑定日志记录,当错误发生时,我们得到一个绑定日志文件。

The operation failed.
Bind result: hr = 0x80070002. The system cannot find the file specified.

Assembly manager loaded from:  C:\Windows\Microsoft.NET\Framework\v2.0.50727\mscorwks.dll
Running under executable  C:\Windows\SysWOW64\inetsrv\w3wp.exe
--- A detailed error log follows. 

=== Pre-bind state information ===
LOG: User = WEBFUND\WF6User
LOG: Where-ref bind. Location = C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET     Files\clients\6c02a9d4\233e1482\App_Web_emailpdf.aspx.afcecd13.5bzg9b2a.dll
LOG: Appbase = file:///D:/FinancialExpress/ClientsV21/
LOG: Initial PrivatePath = D:\FinancialExpress\ClientsV21\bin
LOG: Dynamic Base = C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\clients\6c02a9d4
LOG: Cache Base = C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\clients\6c02a9d4
LOG: AppName = 233e1482
Calling assembly : (Unknown).
===
WRN: Native image will not be probed in LoadFrom context. Native image will only be probed in default load context, like with Assembly.Load().
LOG: Start binding of native image App_Web_emailpdf.aspx.afcecd13.5bzg9b2a, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null.
LOG: IL assembly loaded from C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET     Files\clients\6c02a9d4\233e1482\App_Web_emailpdf.aspx.afcecd13.5bzg9b2a.dll.
WRN: No matching native image found.
LOG: Bind to native image assembly did not succeed. Use IL image.

我已经在服务器上复制了depends.exe并运行它。它提供了两个未找到的文件:GPSVC.DLL和IESHIMS.DLL。但这可能是问题吗?鉴于大多数页面都正确显示,如果缺少这些文件,它是否总是不起作用?

1 个答案:

答案 0 :(得分:1)

我认为这个问题的答案是避免在bin文件夹中放置强名称程序集。显然微软不支持这一点,虽然它似乎可行。强名命的组件应放在GAC中。