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

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

问题描述

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

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

无法加载文件或程序集'Microsoft.WindowsAzure.Storage,版本= 8.1.1.0,文化=中性,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?

推荐答案

原来是版本不匹配的问题.当前,WindowsAzure.Storage软件包的版本随AzureFunctions is 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函数的开箱即用项相匹配.我希望Microsoft在以后的修订中改善这种体验.

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函数-无法加载文件或程序集'Microsoft.WindowsAzure.Storage'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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