44

Fixing Error NETSDK1152 after upgrading to .NET 6

 2 years ago
source link: https://www.poppastring.com/blog/fixing-error-netsdk1152-after-upgrading-to-net-6
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client
Fixing Error NETSDK1152 after upgrading to .NET 6
This website uses cookies to ensure you get the best experience on our website. Learn More.

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>
<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.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK