gpt4 book ai didi

c# - 为什么 VS Studio 2019 构建失败,找不到 Microsoft.Azure.WebJobs.Host,但 dotnet 构建成功?

转载 作者:行者123 更新时间:2023-12-03 05:41:25 25 4
gpt4 key购买 nike

我有一个 Azure Functions 项目,其中创建了一个 Durable Function。当我想在 VS 2019 中构建这个项目时,出现以下错误。但是 dotnet build 成功了,我也可以从 Rider 构建项目。

没有像Microsoft.Azure.WebJobs.Host这样的包,或者至少我没有在Nuget包管理器中找到它。

这里出了什么问题?我无法决定VS是对的,还是Rider/命令行是对的。

Error: System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Azure.WebJobs.Host, Version=3.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified. File name: 'Microsoft.Azure.WebJobs.Host, Version=3.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' at System.Reflection.RuntimeAssembly.GetExportedTypes(RuntimeAssembly assembly, ObjectHandleOnStack retTypes) at System.Reflection.RuntimeAssembly.GetExportedTypes() at MakeFunctionJson.FunctionJsonConverter.TryGenerateFunctionJsons()
at MakeFunctionJson.FunctionJsonConverter.TryRun()

WRN: Assembly binding logging is turned OFF. To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1. Note: There is some performance penalty associated with assembly bind failure logging. To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].

Error generating functions metadata (1, 1)

最佳答案

由于某些原因,.csproj 文件中的 AzureFunctionsVersion 未正确设置。我有以下内容,该项目在 VS 2019 中编译也没有任何错误。

<AzureFunctionsVersion>v2</AzureFunctionsVersion>

关于c# - 为什么 VS Studio 2019 构建失败,找不到 Microsoft.Azure.WebJobs.Host,但 dotnet 构建成功?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58435856/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com