c# - 从 azure webjob 调用单独 dll 上的方法时出错

标签 c# azure azure-webjobssdk

我有一个网络作业在我的 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/

相关文章:

c# - MOSS 2007 在 XP 机器上使用 C# 导出文档

c# - MVC4 Bundle 中的 {version} 通配符

Azure AD Oauth2/OpenID Connect Web 应用身份验证问题

linux - 在 Bash Cloud Shell 中映射 Azure 文件共享

python - 部署成功后,Azure Function App 运行旧代码

azure - 最新 webjob 更新 0.3.0 后无法将流输出到 blob

azure-webjobs - TimerTrigger 调度和代码执行时间

c# - 从 mvc View 中发布 IEnumerable 集合

azure - 计划的 Azure WebJob Scheduler 日志突然报告 401 - 未经授权

c# - 带复合键的 Linq Join()