So my upgrade of DasBlog Core to .NET 6 was so smooth, I still think this is fairly cool given much of this code was developed under .NET 1.1. I was also pretty excited about the upgrade because I noticed that Azure App Services has day one support for .NET 6, so I thought let’s just do this!
Only one small hitch to speak of, when I started building using Azure DevOps I started to see the following error
error NETSDK1152: Found multiple publish output files with the same relative path
Showed up like this:
Nothing rang a bell here, and I actually did not find an exact reference to this error number. What I did find was overlap with the error text relating to public output files (NETSDK1148). This error seems to be generated by the SDK when MSBuild detects duplicate files in the publish output but cannot figure out which file to keep (new to .NET 6).
I am gonna be honest with you I am unsure how to fix this problem, but I do know how to ignore it (story of my life). The newly introduced ErrorOnDuplicatePublishOutputFiles tells the build process not to generate the error. Added it to the Project file that is failing as follows:
<PropertyGroup> <ErrorOnDuplicatePublishOutputFiles>false</ErrorOnDuplicatePublishOutputFiles> </PropertyGroup>
I do dislike this kind of black box solution so if someone actually knows what I need to resolve in my code to fix this issue correctly please share on Twitter or the the comments here.
I was able to resolve it by setting the Microsoft.NET.ConflictResolution.targets file under the <NETSdkError Condition="'$(_ResolvedFileToPublishContainsDuplicates)' == 'false'" <= this was originally true.
This file is located in "\Program Files\dotnet\sdk\6.0.100\Sdks\Microsoft.NET.Sdk\targets\".
I can't really see which duplicate files were being generated but our issue was due to the fact that nservicebus was generating sql files...
We fixed this by adding the following to the corresponding folders:
Comments are closed.