gpt4 book ai didi

visual-studio - Azure Functions 发布不会复制所有文件

转载 作者:行者123 更新时间:2023-12-02 06:40:23 26 4
gpt4 key购买 nike

当我将我的 Azure 函数发布到 Azure 时,并非所有引用的包都会被复制。因此,我收到一条错误,指出找不到特定文件 (Microsoft.CodeAnalysis.dll)。

我已确保在我的 azure 函数项目中引用了该包:

enter image description here

并检查它是否在 .csproj 文件中:

enter image description here

当我在本地构建时,该文件包含在\bin 目录中:

enter image description here

但是当我发布到 azure 时,文件丢失了:

enter image description here

引用文件时,这会给我运行时错误:

enter image description here

如何强制将文件包含在发布到 azure 的内容中,在 Visual Studio 的本例中,没有“复制到输出目录”或类似选项:

enter image description here

最佳答案

此问题在 Azure Functions (.NET 5.0) 中已解决,但在 .NET Core 3.1 中使用

  <PropertyGroup>                         
<_FunctionsSkipCleanOutput>true</_FunctionsSkipCleanOutput>
</PropertyGroup>

在 Azure Functions 的项目文件中作为解决方法。详情请查看https://github.com/Azure/Azure-Functions/issues/1525

关于visual-studio - Azure Functions 发布不会复制所有文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63915608/

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