私は、Microsoft.Practices.EnterpriseLibrary.Data dll を週に 1 回ロードする際に問題があるかなり単純な内部 ASP.Net Web サイトを持っています。例外メッセージは次のとおりです。
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 リセットで問題が解決します。
- 単一の Web サーバーで同じコードを問題なく実行できました。次に、負荷分散された (スティッキー セッションを使用する) 2 つの新しい Web サーバー (3 つすべての Windows Server 2003 R2 Standard Edition SP1) にサイトを移動しました。現在、負荷分散された各 Web サーバーは、この例外を 1 週間に 1 回、突然スローします。
- 私が思いつく唯一の大きな違いは、負荷分散されたサーバーに 4.0 .NET フレームワークをインストールしたことです。Web サイトはまだ ASP.NET 2.0 で実行されているため、これがどのように問題になるかわかりません。
- 「Temporary ASP.NET Files」フォルダーを検索しないようにインデックス サービスを構成しましたが、役に立ちませんでした。
- サイトのいたるところで Microsoft.Practices.EnterpriseLibrary.Data dll を使用しています。ほぼすべてのページで、EnterpriseLibrary dll を利用するロジック dll が使用されています。
- 一度エラーが発生している間、「Temporary ASP.NET Files」フォルダー内の dll をロックしているプロセスを確認しましたが、正常に機能していたサーバーのロックと何ら変わりはありませんでした。
- エラーが発生すると、iisreset が実行されるまで毎回エラーが発生します
誰でも提供できる洞察は大歓迎です。何か見逃した場合はお知らせください。
ありがとう!