Quantcast
Channel: Active questions tagged blazor - Stack Overflow
Viewing all articles
Browse latest Browse all 4213

Why do I keep getting error NETSDK1152: Found multiple publish output files with the same relative path?

$
0
0

I have a Blazor Server .NET 7 solution with the main entry project called Web.csproj. There are other projects such as Api, WebApi, WebConstants etc... When I build this blazor server project in Visual Studio, all works fine, but when I run the following msbuild command:

msbuild .\Web\Web\Web.csproj /p:SolutionDir=c:\Users\me\Documents\Repos\solution\ /p:DeployOnBuild=true /p:PublishProfile=FolderProfile

I get the following error:

C:\Program Files\dotnet\sdk\7.0.403\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.ConflictResolution.targets(112,5): error NETSDK1152: Found multiple publish output files with the same relative path:   C:\Users\me\Documents\Repos\solution\Web\Alarming\bin\Debug\net7.0\Api.dll.config,   C:\Users\me\Documents\Repos\solution\Web\WebComponents\bin\Debug\net7.0\Api.dll.config,   C:\Users\me\Documents\Repos\solution\Web\ElementSelectorWindow\bin\Debug\net7.0\Api.dll.config,   C:\Users\me\Documents\Repos\solution\Web\Faceplate\bin\Debug\net7.0\Api.dll.config,   C:\Users\me\Documents\Repos\solution\Web\Logs\bin\Debug\net7.0\Api.dll.config,   C:\Users\me\Documents\Repos\solution\Web\Summary\bin\Debug\net7.0\Api.dll.config,   C:\Users\me\Documents\Repos\solution\Web\Tracking\bin\Debug\net7.0\Api.dll.config, C:\Users\me\Documents\Repos\solution\Web\WebComponents\bin\Debug\net7.0\WebComponents.staticwebassets.runtime.json, C:\Users\me\Documents\Repos\solution\Web\ElementSelectorWindow\bin\Debug\net7.0\WebComponents.staticwebassets.runtime.json, C:\Users\me\Documents\Repos\solution\Web\Faceplate\bin\Debug\net7.0\WebComponents.staticwebassets.runtime.json, C:\Users\me\Documents\Repos\solution\Web\Logs\bin\Debug\net7.0\WebComponents.staticwebassets.runtime.json, C:\Users\me\Documents\Repos\solution\Web\Summary\bin\Debug\net7.0\WebComponents.staticwebassets.runtime.json, C:\Users\me\Documents\Repos\solution\Web\WebComponents\bin\Release\net7.0\WebComponents.staticwebassets.runtime.json, C:\Users\me\Documents\Repos\solution\Web\ElementSelectorWindow\bin\Release\net7.0\WebComponents.staticwebassets.runtime.json, C:\Users\me\Documents\Repos\solution\Web\Faceplate\bin\Release\net7.0\WebComponents.staticwebassets.runtime.json, C:\Users\me\Documents\Repos\solution\Web\Logs\bin\Release\net7.0\WebComponents.staticwebassets.runtime.json, C:\Users\me\Documents\Repos\solution\Web\Summary\bin\Release\net7.0\WebComponents.staticwebassets.runtime.json, 

I solved these errors by following advice from here and included the following in each of my csproj files:

<PropertyGroup><ErrorOnDuplicatePublishOutputFiles>false</ErrorOnDuplicatePublishOutputFiles></PropertyGroup>

but I think this is just putting a bandate on the real problem. What are these dll.config and staticwebassets.runtime.json files that are produced each time a project is referenced by another and how can I solve this error properly?

Perhaps I should mention, Api is a project referenced by numerous others such as Alarming, WebComponents, ElementSelectorWindow, etc...


Viewing all articles
Browse latest Browse all 4213

Trending Articles