2012-07-26 46 views
0

當我創建了使用芥末「自動縮放」功能在Windows Azure項目,我有以下例外,我也有配置app.config文件:Windows Azure的芥末

異常

「無法加載文件或程序集'Microsoft.WindowsAzure.StorageClient,版本= 1.1.0.0,Culture = neutral,PublicKeyToken = 31bf3856ad364e35'或它的一個依賴項,找到的程序集清單定義與程序集引用不匹配。來自HRESULT:0x80131040)「

Autoscaler objAutoScaler = EnterpriseLibraryContainer.Current.GetInstance(); //這裏我有例外

請幫忙嗎?

回答

1

我不知道你是否仍然存在這個問題,但是你有沒有在你的項目中引用這些程序集?

Microsoft.WindowsAzure.StorageClient

Microsoft.WindowsAzure.ServiceRuntime

此外,如果您使用的是Azure的SDK 1.7版本,你需要在你的應用程序添加此節。配置:

<runtime> 
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> 
    <dependentAssembly> 
    <assemblyIdentity name="Microsoft.WindowsAzure.ServiceRuntime" publicKeyToken="31BF3856AD364E35" culture="neutral"/> 
    <bindingRedirect oldVersion="0.0.0.0-1.7.0.0" newVersion="1.7.0.0"/> 
    </dependentAssembly> 
</assemblyBinding> 
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> 
    <dependentAssembly> 
    <assemblyIdentity name="Microsoft.WindowsAzure.StorageClient" publicKeyToken="31BF3856AD364E35" culture="neutral"/> 
    <bindingRedirect oldVersion="0.0.0.0-1.7.0.0" newVersion="1.7.0.0"/> 
    </dependentAssembly> 
</assemblyBinding>