我剛剛爲我的項目設置了一個連續的部署版本(使用azure TFS服務aka visualstudio.com) ,但它不正確。構建看起來很好,部署開始,但我的工作人員角色始終不斷回收。我的手動構建通過管理門戶部署的Visual Studio工作得很好。當我遠程化到工人的虛擬機之一,看看發生了什麼事情,我發現這個事件日誌:TFS構建服務生成一個引用msshrtmi的錯誤版本的包(應該是1.7,最後引用1.8)
An unhandled exception occurred. Type: Autofac.Core.DependencyResolutionException Process ID: 2488
Process Name: WaWorkerHost
Thread ID: 13
AppDomain Unhandled Exception for role MyProject.Worker_IN_1
Exception: An exception was thrown while invoking the constructor 'Void .ctor(Microsoft.WindowsAzure.CloudStorageAccount)' on type 'TemplateRepository'.
at MyProject.Worker.WorkerRole.Run() in c:\a\src\MyProject\Dev\MyProject.Worker\WorkerRole.cs:line 383
at Microsoft.WindowsAzure.ServiceRuntime.RoleEnvironment.StartRoleInternal()
at Microsoft.WindowsAzure.ServiceRuntime.Implementation.Loader.RoleRuntimeBridge.<startrole>b__1()
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
Inner Exception: The type initializer for 'Microsoft.WindowsAzure.ServiceRuntime.RoleEnvironment' threw an exception.
at Microsoft.WindowsAzure.ServiceRuntime.RoleEnvironment.GetConfigurationSettingValue(String configurationSettingName)
at MyProject.Worker.Core.Repositories.TemplateRepository..ctor(CloudStorageAccount account) in c:\a\src\MyProject\Dev\MyProject.Worker.Core\Repositories\TemplateRepository.cs:line 24
at lambda_method(Closure , Object[])
at Autofac.Core.Activators.Reflection.ConstructorParameterBinding.Instantiate()
Inner Exception: Could not load file or assembly 'msshrtmi, Version=1.8.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)
at Microsoft.WindowsAzure.ServiceRuntime.RoleEnvironment.InitializeEnvironment()
at Microsoft.WindowsAzure.ServiceRuntime.RoleEnvironment..cctor()
似乎出於某種原因,建立在TFS進行構建服務器風與不正確的參考1.8的msshrtmi,而不是1.7(這是我所有的項目實際參考)。我嘗試添加一個明確的msshrtmi引用,並且我也嘗試了這裏找到的建議(http://tomkrueger.wordpress.com/2010/07/27/azure-deployment-issue-after-upgrading-to-visual-studio- 2010-and-net-4-0 /),似乎都沒有工作。
其他建議?
更新:這裏是我的cross-post on MSDN forums
這是我的想法,但我檢查了所有的參考文獻,他們都指向1.7(或1.7.0.3)。此外,我可以通過從Visual Studio發佈或手動上傳軟件包,從我的開發人員工作站進行部署。因此,我相當確定這個問題出現在構建服務器上。 –