Bra*_*ick 12 .net c# nuget azure-functions
在 Azure Functions 中使用NuGet.Protocol NuGet 包时,出现以下错误:System.Private.CoreLib: Could not load file or assembly。
[4/18/2020 8:51:43 AM] The 'Function1' function is in error: Unable to load one or more of the requested types.
[4/18/2020 8:51:43 AM] Could not load file or assembly 'NuGet.Protocol, Version=5.5.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. The system cannot find the file specified.
[4/18/2020 8:51:43 AM] Microsoft.Azure.WebJobs.Host: Error indexing method 'Function1'. System.Private.CoreLib: Could not load file or assembly 'NuGet.Protocol, Version=5.5.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. The system cannot find the file specified.
Run Code Online (Sandbox Code Playgroud)
NuGet.Protocol.dll我确认输出中存在该文件bin。
为什么Azure Functions找不到NuGet.Protocol.dll?
Bra*_*ick 32
这是Azure Functions 的一个已知问题,在Microsoft.NET.Sdk.Functionsv3.0.4中引入,至今仍然存在 (v3.0.11)。
要防止 Azure Functions 删除此库,请将以下内容添加到您的 CSPROJ:
<PropertyGroup>
<_FunctionsSkipCleanOutput>true</_FunctionsSkipCleanOutput>
</PropertyGroup>
Run Code Online (Sandbox Code Playgroud)
以下是我如何在GitTrends应用程序中使用它的示例: https://github.com/brminnick/GitTrends/blob/22d748fc72452dcd39bb3866e30f339827ded3dd/GitTrends.Functions/GitTrends.Functions.csproj#L10
| 归档时间: |
|
| 查看次数: |
7282 次 |
| 最近记录: |