While running my pipeline, it fails at the publish phase with 2 errors.
##[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. 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.
<PropertyGroup>
<ErrorOnDuplicatePublishOutputFiles>false</ErrorOnDuplicatePublishOutputFiles>
</PropertyGroup>
This is where I found it. 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
You have multiple ways of fixing this:
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.