[英]How do I fix Azure pipeline error NETSDK1152?
While running my pipeline, it fails at the publish phase with 2 errors.运行我的管道时,它在发布阶段失败并出现 2 个错误。
##[error]Error: The process 'C:\Program Files\dotnet\dotnet.exe' failed with exit code 1
##[error]Dotnet command failed with non-zero exit code on the following projects : ...
The pipeline also lists all paths to files with duplicate names, even if the contents are different.管道还列出了具有重复名称的文件的所有路径,即使内容不同也是如此。 The pipeline worked fine before with the duplicate names, but now throws and error and will not proceed.
管道在使用重复名称之前工作正常,但现在抛出错误并且不会继续。 what is the correct fix for this?
正确的解决方法是什么?
I think my pipeline is using Dotnet6 even though the app is only 3.1, and this was added to fix it.我认为我的管道正在使用 Dotnet6,即使该应用程序只有 3.1,并且添加了它来修复它。 I don't know if this is the correct fix, but it is working.
我不知道这是否是正确的修复,但它正在起作用。
I added this to the csproj files that have duplicate file names.我将此添加到具有重复文件名的 csproj 文件中。
<PropertyGroup>
<ErrorOnDuplicatePublishOutputFiles>false</ErrorOnDuplicatePublishOutputFiles>
</PropertyGroup>
This is where I found it.这是我找到它的地方。 https://docs.microsoft.com/en-us/dotnet/core/project-sdk/msbuild-props#erroronduplicatepublishoutputfiles
https://docs.microsoft.com/en-us/dotnet/core/project-sdk/msbuild-props#erroronduplicatepublishoutputfiles
This is a breaking change introduced in .NET 6 https://learn.microsoft.com/en-us/do.net/core/compatibility/sdk/6.0/duplicate-files-in-output这是 .NET 6 https://learn.microsoft.com/en-us/do.net/core/compatibility/sdk/6.0/duplicate-files-in-output中引入的重大更改
You have multiple ways of fixing this:您有多种方法可以解决此问题:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.