Azure Functions - 无法加载文件或程序集“Microsoft.WindowsAzure.Storage" [英] Azure Functions - Could not load file or assembly ''Microsoft.WindowsAzure.Storage'

查看:18
本文介绍了Azure Functions - 无法加载文件或程序集“Microsoft.WindowsAzure.Storage"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

即使我在 project.json 文件中指定了依赖项,我也有一个 azure 函数引发以下错误.

I have an azure function that is throwing following error even after i have the dependencies specified in project.json file.

无法加载文件或程序集 'Microsoft.WindowsAzure.Storage, Version=8.1.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' 或其依赖项之一.系统找不到指定的文件."

"Could not load file or assembly 'Microsoft.WindowsAzure.Storage, Version=8.1.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified."

{
  "frameworks": {
    "net46": {
      "dependencies": {
        "WindowsAzure.Storage": "8.1.1"
      }
    }
  }
}

我已尝试重新启动应用服务,创建另一个 FunctionApp 以排除主机未加载更新程序集的任何问题,但我仍然无法使其工作.

I have tried to restart the app service, creating another FunctionApp to rule out any issue with host not loading the updated assemblies, still i cannot get it to work.

Nuget restore 还显示此程序集正在恢复,但仍不断出现此错误.还有什么问题以及如何调试此问题?

Nuget restore also shows that this assembly is being restored but still it keeps giving this error. What else can be wrong and how to go about debugging this issue?

推荐答案

原来是版本不匹配问题.目前,AzureFunctions 可用的 WindowsAzure.Storage 包的版本是 7.2.1.我有一个依赖于 8.1.1 的自定义程序集,这就是我尝试使用 project.json 安装它的原因.

It turned out to be a version mismatch issue. Currently, the version of WindowsAzure.Storage package available with AzureFunctions is 7.2.1. I had a custom assembly that had dependencies on 8.1.1 and that is why i was trying to install that using project.json.

显然不能.我切换到 7.2.1 然后它工作得很好.如果您正在编写预编译函数,这总是会出现问题,因为依赖项应该与 Azure Functions 开箱即用的可用内容相匹配.我希望微软在未来的修订版中改进这种体验.

Apparently it cannot be done. I switched to 7.2.1 and then it worked just fine. This is always going to be in issue if you are writing precompiled functions because the dependencies should match what is available out of the box with Azure Functions. I hope Microsoft improves this experience in future revisions.

这篇关于Azure Functions - 无法加载文件或程序集“Microsoft.WindowsAzure.Storage"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆