在尝试从Enterprise 5.0IntegrationPackforWindowsAzure工作中获得这 Azure自动示范性演示项目时,遇到了此错误。当所有指令正确执行时引发的错误是:
在试图获取c:\Home\Chris\Projects\CommonServiceLocator\main\M icrosoft.Practices.ServiceLocation\ServiceLocatorImplBase.cs:line 57中的自动分频器,键at icrosoft.Practices.ServiceLocation\ServiceLocatorImplBase.cs:line e serviceType,String key)实例时发生激活错误 在Microsoft.Practices.ServiceLocation.ServiceLocatorImplBase.GetInstanceTSe服务器上,c:\Home\Chris\Projects\CommonServiceLocator\main\Microsoft.Practices .ServiceLocation\ServiceLocatorImplBase.cs:line 90 at PB_WASABi_autoscaler.Program.Main(String[] args),c:\Users\daniel\Documents\Visual 2012\Projects\PB-WASABi-autoscaler\PB-WASABi-autoscaler\Progr am.cs:line 13
使用WindowsAzure1.7库。
发布于 2012-10-31 15:39:25
教程(和其他在线资源)主要使用Azure1.6SDK。
当控制台应用程序中有来自AzureSDK1.6的WindowsAzure.StorageClient.dll文件的引用时,它就能工作。在AzureSDK1.7环境下,会出现以下错误消息:在试图获取自动分频器( key )类型的实例时发生了激活错误。在错误细节中,我们发现:无法加载文件或程序集'Microsoft.WindowsAzure.StorageClient、Version=1.1.0.0、Culture=neutral、PublicKeyToken=31bf3856ad364e35‘或其依赖项之一。所定位的程序集的清单定义与程序集引用不匹配。(HRESULT除外: 0x80131040)。
解决方案:
app.config文件中的绑定重定向将解决以下问题:
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Microsoft.WindowsAzure.StorageClient"
publicKeyToken="31bf3856ad364e35"
culture="neutral" />
<bindingRedirect oldVersion="1.1.0.0"
newVersion="1.7.0.0"/>
</dependentAssembly>
</assemblyBinding>
</runtime>来源:这里
https://stackoverflow.com/questions/13161599
复制相似问题