我有一个网络作业在我的 azure 环境中运行。我正在一个单独的 dll 中的类上调用一个方法。但出现以下错误:
无法加载文件或程序集“Microsoft.WindowsAzure.ServiceRuntime,Version=2.4.0.0,Culture=neutral,PublicKeyToken=31bf3856ad364e35”
我是否还需要在单独的项目上安装 azure sdk?
有人可以澄清一下吗?
谢谢
最佳答案
当您使用的库引用了旧版本的 dll,并且您的 web 作业部署了新版本时,可能会出现此问题。
您可以在 app.config 中添加绑定(bind)重定向,如本页所述:https://msdn.microsoft.com/en-us/library/7wd6ex19(v=vs.110).aspx
检查您在项目中引用的 Microsoft.WindowsAzure.ServiceRuntime 版本,只需在 app.config 中添加一行:
<dependentAssembly>
<assemblyIdentity name="Microsoft.WindowsAzure.ServiceRuntime"
publicKeyToken="31bf3856ad364e35"
culture="en-us" />
<bindingRedirect oldVersion="2.4.0.0" newVersion="YOUR_VERSION" />
</dependentAssembly>
希望这有帮助,
朱利安
关于c# - 从 azure webjob 调用单独 dll 上的方法时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33077772/