https://github.com/WindowsAzure/azure-sdk-for-net/tree/sdk_1.7.1で入手できる Microsoft.WindowsAzure.StorageClient バージョン 1.7.1.0 を使用しています。私のプロジェクトは問題なくコンパイルされますが、実行すると次のエラーが発生します。
Could not create Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener, Microsoft.WindowsAzure.Diagnostics, Version=1.7.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35.
内部例外:
Could not load file or assembly 'Microsoft.WindowsAzure.StorageClient, Version=1.7.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)":"Microsoft.WindowsAzure.StorageClient, Version=1.7.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
Microsoft.WindowsAzure.StorageClient のバージョン 1.7.0.0 に対する Microsoft.WindowsAzure.Diagnostics に依存関係があるようです。ただし、バージョン 1.7.1.0 を使用しています。私の知る限り、同じプロジェクトに 1.7.0 と 1.7.1 の両方を含めることはできません。これが実際に問題である場合、Microsoft.WindowsAzure.Diagnostics を 1.7.1 に依存させる方法はありますか?
ありがとう、カート
アップデート
以下の推奨事項に従って、gacutil を使用してバージョン 1.7.0 をロードするためのスタートアップ タスクを追加しました (これはhttp://blogs.infosupport.com/adding-assemblies-to-the-gac-in-windows-azure/で役立ちました)。2 つの WorkerRoles と 2 つの WebRoles があります。私が今抱えている問題は、コンパイルして実行すると、バージョン 1.7 への直接参照がないにもかかわらず、VS2012 が 1.7.0 を WebRoles のそれぞれの ...\csx\Debug\roles[WebRoleName]\approot フォルダーにコピーすることです。プロジェクトで 0。次のコンパイル出力は、Azure がバージョン 1.7.1 を読み込もうとしたときに発生するエラーを示しています (現在は見つかりません)。
System.TypeLoadException: Unable to load the role entry point due to the following exceptions:
-- System.IO.FileLoadException: Could not load file or assembly 'Microsoft.WindowsAzure.StorageClient, Version=1.7.1.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
File name: 'Microsoft.WindowsAzure.StorageClient, Version=1.7.1.0, Culture=neutral, PublicKeyToken=null'
=== Pre-bind state information ===
LOG: User = BERTIES_MAIN\kurt_000
LOG: DisplayName = Microsoft.WindowsAzure.StorageClient, Version=1.7.1.0, Culture=neutral, PublicKeyToken=null
(Fully-specified)
LOG: Appbase = file:///H:/Everything/Current_Work/Web_Apps/Azure/InSysCloud/InSysCloud/InSysCloud/csx/Debug/roles/InSysWatcher/approot
LOG: Initial PrivatePath = H:\Everything\Current_Work\Web_Apps\Azure\InSysCloud\InSysCloud\InSysCloud\csx\Debug\roles\InSysWatcher\approot
Calling assembly : InSysWatcher, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null.
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: H:\Everything\Current_Work\Web_Apps\Azure\InSysCloud\InSysCloud\InSysCloud\csx\Debug\roles\InSysWatcher\approot\InSysWatcher.dll.config
LOG: Using host configuration file:
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\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:///H:/Everything/Current_Work/Web_Apps/Azure/InSysCloud/InSysCloud/InSysCloud/csx/Debug/roles/InSysWatcher/approot/Microsoft.WindowsAzure.StorageClient.DLL.
WRN: Comparing the assembly name resulted in the mismatch: PUBLIC KEY TOKEN
ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated.
1.7.1 がプロジェクト自体で参照され、バージョン 1.7.0 がコンテンツとしてのみ含まれ、アプリの起動時に GAC に読み込まれる場合、VS2012 がバージョン 1.7.0 の DLL を追加するのはなぜですか?