我試圖運行VS2012的Azure的解決方案,它包含三個項目:不能與StorageClient運行Azure項目1.7.1
- InSysDashboard(Web角色)
- InSysService(Web角色)
- InSysWatcher(工作者角色)
在3.被添加之前,1.和2.建立和部署就好了。 3.自行構建並部署好(但當然這並不好,因爲角色不能單獨部署,需要作爲同一個包的一部分部署)。
該問題似乎與Azure SDK 1.7.1 Microsoft.WindowsAzure.StorageClient,我從https://github.com/WindowsAzure/azure-sdk-for-net/tree/sdk_1.7.1下載和編譯。我正在使用此資源中的Microsoft.WindowsAzure.StorageClient和Microsoft.WindowsAzure.Configuration庫以及VS2012 1.7 June SDK中的Microsoft.WindowsAzure.Diagnostics和Microsoft.WindowsAzure.ServiceRuntime。
包含所有三個項目的解決方案編譯時沒有錯誤。
在任何項目中沒有明確提到Microsoft.WindowsAzure.StorageClient 1.7,只有1.7.1。
但是,當我嘗試運行該解決方案時,工作角色(3.)無法加載。有輸出窗口包含以下片段:
'WaIISHost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.ApplicationServices\v4.0_4.0.0.0__31bf3856ad364e35\System.Web.ApplicationServices.dll'
'WaIISHost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Data.Entity\v4.0_4.0.0.0__b77a5c561934e089\System.Data.Entity.dll'
Microsoft.WindowsAzure.ServiceRuntime Information: 200 : Role entrypoint . CALLING OnStart()
Microsoft.WindowsAzure.ServiceRuntime Information: 203 : Role entrypoint . CALLING Run()
Microsoft.WindowsAzure.ServiceRuntime Information: 100 : Role environment . INITIALED RETURNED. HResult=0
'WaIISHost.exe' (Managed (v4.0.30319)): Loaded 'F:\Everything\Current_Work\Web_Apps\Azure\InSys\InSysCloud\csx\Debug\roles\InSysService\approot\bin\Microsoft.WindowsAzure.Diagnostics.dll'
Microsoft.WindowsAzure.ServiceRuntime Information: 101 : Role environment . INITIALIZED
'WaWorkerHost.exe' (Managed (v4.0.30319)): Loaded 'F:\Everything\Current_Work\Web_Apps\Azure\InSys\InSysCloud\csx\Debug\roles\InSysWatcher\approot\Microsoft.WindowsAzure.StorageClient.dll'
Microsoft.WindowsAzure.ServiceRuntime Information: 202 : Role entrypoint . COMPLETED OnStart()
The thread 'Role Initialization Thread' (0xaa4) has exited with code 0 (0x0).
Microsoft.WindowsAzure.ServiceRuntime Information: 203 : Role entrypoint . CALLING Run()
'WaWorkerHost.exe' (Managed (v4.0.30319)): Loaded 'F:\Everything\Current_Work\Web_Apps\Azure\InSys\InSysCloud\csx\Debug\roles\InSysWatcher\approot\InSysWatcher.dll', Symbols loaded.
'WaWorkerHost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.ApplicationServices\v4.0_4.0.0.0__31bf3856ad364e35\System.Web.ApplicationServices.dll'
Microsoft.WindowsAzure.ServiceRuntime Critical: 201 : Role entrypoint could not be created:
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 = BertiesExtreme\bertie
LOG: DisplayName = Microsoft.WindowsAzure.StorageClient, Version=1.7.1.0, Culture=neutral, PublicKeyToken=null
(Fully-specified)
LOG: Appbase = file:///F:/Everything/Current_Work/Web_Apps/Azure/InSys/InSysCloud/csx/Debug/roles/InSysWatcher/approot
LOG: Initial PrivatePath = F:\Everything\Current_Work\Web_Apps\Azure\InSys\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: F:\Everything\Current_Work\Web_Apps\Azure\InSys\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:///F:/Everything/Current_Work/Web_Apps/Azure/InSys/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.
-- 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'
中的最後一項似乎表明與Microsoft.WindowsAzure.StorageClient一個問題。
如果我期待產生的CSX文件夾內,當解決方案建立,對於每一個項目,我發現:
- 發佈/角色/ InSysDashboard /爲approot/Microsoft.WindowsAzure.StorageClient.dll(這是1.7.1)
- 推出/角色/ InSysService /爲approot/Microsoft.WindowsAzure.StorageClient.dll(這是1.7.1)
- 推出/角色/ InSysWatcher /爲approot/Microsoft.WindowsAzure.StorageClient.dll(這是1.7.0)
由於某些原因,Microsoft.WindowsAzure.StorageClient.dll的1.7.0版包含在工作者角色中。我檢查了參考列表,它絕對包含1.7.1 NOT 1.7.0,那麼爲什麼1.7.0包含在內?我在這個階段假設這是Worker Role未運行的原因。
任何想法?
一些更多的信息:
如果我取代在C Microsoft.WindowsAzure.StorageClient.dll(1.7.0.0)的版本:\ Program Files文件\微軟的SDK \的Windows Azure.NET SDK \ 2012-06 \參考1.7.1.0版本,然後我得到一個與Microsoft.WindowsAzure.Diagnostics有關的錯誤。
{"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.Diagnostics對Microsoft.WindowsAzure.StorageClient 1.7.0.0的依賴,並因此與1.7.1.0替換它導致問題。我想依賴是硬編碼的。