Azure 函数 - 无法加载文件或程序集

Azure Function - Could not load file or assembly

我 运行 Azure Function .NET Standard 2.0 并收到以下错误:

An exception of type 'System.IO.FileLoadException' occurred in Function.dll but was not handled in user code Could not load file or assembly 'Microsoft.WindowsAzure.Storage, Version=9.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.

程序集文件存在于 bin/debug 文件夹中。一直在阅读一些关于此的主题但没有解决方案 (https://github.com/Azure/azure-functions-core-tools/issues/322#issuecomment-352233979),有人知道该怎么做吗?

我正在使用来自另一个 .NET Standard 2.0 项目的代码,但我的所有项目都引用了 Microsoft.WindowsAzure.Storage 9.2.0.0 并且安装了该 nuget 包。

谢谢!

您可以在下方添加参考以明确降级您的存储参考。

<PackageReference Include="WindowsAzure.Storage" Version="8.6.0" />

看到这个issue comment

This restriction (like many of the other assembly version restrictions we had with other extensions) is a temporary issue and will be addressed in upcoming preview releases.

此问题已在最新主机 2.0.11888 中修复,但内置的 cli(运行 功能的工具)尚不可用。

更新

2.0.11888 已对 VS 用户可用。