为什么我会收到System.IO.FileLoadException:无法加载在我的ASP.Net网站文件或程序集,约每周一次? [英] Why do I get System.IO.FileLoadException: Could not load file or assembly, about once a week on my ASP.Net Website?

查看:332
本文介绍了为什么我会收到System.IO.FileLoadException:无法加载在我的ASP.Net网站文件或程序集,约每周一次?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有了装载大约一个星期一次Microsoft.P​​ractices.EnterpriseLibrary.Data DLL问题相当简单的内部ASP.Net网站。下面是异常消息:

I have a rather simple internal ASP.Net Website that has issues loading the Microsoft.Practices.EnterpriseLibrary.Data dll about once a week. Here is the Exception message:

System.IO.FileLoadException: Could not load file or assembly 'Microsoft.Practices.EnterpriseLibrary.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. Access is denied.
File name: 'Microsoft.Practices.EnterpriseLibrary.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null'
   at foobar.Intranet.Logic.Data.UserDB.SelectByUserName(String userName)
   at foobar.Intranet.Logic.Info.User.ValidateUser(String userName) in F:\Development\foobar\foobar\foobar.Intranet.Logic\Info\User.cs:line 130
   at Login.ValidateUser(String username, String password) in e:\foobar\foobar.Intranet\Login.aspx.cs:line 32

=== Pre-bind state information ===
LOG: User = Unknown
LOG: DisplayName = Microsoft.Practices.EnterpriseLibrary.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null
 (Fully-specified)
LOG: Appbase = file:///E:/foobar/foobar.Intranet/
LOG: Initial PrivatePath = E:\foobar\foobar.Intranet\bin Calling assembly : foobar.Intranet.Logic, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null.
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: E:\foobar\foobar.Intranet\web.config
LOG: Using host configuration file: \\?\C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet.config
LOG: Using machine configuration file from C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\config\machine.config.
LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
LOG: Attempting download of new URL file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/Temporary ASP.NET Files/foobar.intranet/668896d8/82d7e51c/Microsoft.Practices.EnterpriseLibrary.Data.DLL.
LOG: Attempting download of new URL file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/Temporary ASP.NET Files/foobar.intranet/668896d8/82d7e51c/Microsoft.Practices.EnterpriseLibrary.Data/Microsoft.Practices.EnterpriseLibrary.Data.DLL.
LOG: Attempting download of new URL file:///E:/foobar/foobar.Intranet/bin/Microsoft.Practices.EnterpriseLibrary.Data.DLL.
ERR: Failed to complete setup of assembly (hr = 0x80070005). Probing terminated.

请注意物联网:


  • 一个简单的IIS重置修复该问题。

  • 我们对没有问题的单一网络服务器相同的code运行。然后,我们搬到现场,两个新的,负载均衡(使用粘性会话)的Web服务器(所有三个Windows Server 2003 R2标准版SP1)。现在每个负载平衡的Web服务器的抛出此异常大约一个星期一次只出蓝色。
    • 唯一的主要区别我能想到的,是我已经安装了负载均衡的服务器上的.NET 4.0框架。该网站仍然是ASP.NET 2.0下运行的,所以我不知道为什么这是一个问题

    任何有识之士任何人都可以提供将大大AP preciated。让我知道如果我错过了什么。

    Any insight anyone could offer would be much appreciated. Let me know if I missed something.

    谢谢!

    推荐答案

    看看的的集绑定日志查看器。它可能指向你在正确的方向。

    Take a look at the Assembly Binding Log Viewer. It might point you in the right direction.

    我有一个快速浏览一下其他SO答案,一人建议,应用程序可能已经开发了针对一个签名版本的DLL但生产运行时只能访问一个无符号的版本。它看起来像你的生产加载未签名的组件(公钥=空)。

    I had a quick look at other SO answers and one person suggested that the application may have been developed against a signed version of the DLL but the production runtime only has access to an unsigned version. It looks like your production is loading an unsigned assembly (PublicKeyToken=null).

    这篇关于为什么我会收到System.IO.FileLoadException:无法加载在我的ASP.Net网站文件或程序集,约每周一次?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆