Microsoft.Azure.WebJobs.Extensions.Http:无法加载文件或程序集

geo*_*joe 28 azure

我在 VS Code 的虚拟环境中工作,我不明白为什么会收到此错误:

[2022-07-19T10:00:31.580Z] A host error has occurred during startup operation '609dfded-e9f5-4fc4-b3a3-554bde11a415'.
[2022-07-19T10:00:31.582Z] Microsoft.Azure.WebJobs.Extensions.Http: Could not load file or assembly 'System.Net.Http.Formatting, Version=5.2.8.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. The system cannot find the file specified.
Value cannot be null. (Parameter 'provider')
Run Code Online (Sandbox Code Playgroud)

我应该检查什么?

小智 47

在 Azure Functions Api 项目上将 nuget 包 Microsoft.NET.Sdk.Functions 从 4.1.3 回滚到 4.1.1。

重建解决方案。


Kev*_*ble 19

这为我解决了这个问题,希望对其他人有帮助

  • 关闭 Visual Studio
  • 删除文件夹 C:\Users***\AppData\Local\AzureFunctionsTools
  • 重新启动 Visual Studio。
  • 启动应用程序,重新创建文件夹。

取自 无法升级 Azure Functions 核心工具,异常“无法创建类型为‘NuGet.Versioning.VersionRange’的实例”


Vic*_*rra 14

我也遇到了这个问题,我的解决方案是重新下载并重新安装Azure Function Core Tools。我认为安装两次就解决了我的问题。


小智 6

我只是更新了图像下方的 vs 选项:

在此输入图像描述

这次更新解决了我的问题


geo*_*joe 1

我对此问题的解决方案是进入 Windows Defender 并排除:

C:\Program Files\Microsoft\Azure Functions Core Tools\func.exe
Run Code Online (Sandbox Code Playgroud)

然后,我重新安装了 Azure Functions Core Tools v4,一切都按预期运行。

诗。排除后,请确保给系统更新时间。我重新启动,一切都按预期进行。希望这对某人有帮助。