1

I have solution in Visual Studio which contains three projects: A user interface project, an API project and a project with unit tests. I want to have a github action, which does the following:

  • Build everything
  • Run the unit tests (currently shared between the UI and API)
  • Publish the UI to one Azure Web App
  • Publish the API to another Azure Web App

My current yaml build file was auto-generated by Azure when I setup the first web app (the UI) and worked fine. It even ran with the unit tests. But after I added the API I get the following build error:

Error: C:\Users\runneradmin\AppData\Local\Microsoft\dotnet\sdk\6.0.101\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.ConflictResolution.targets(112,5): error NETSDK1152: Found multiple publish output files with the same relative path: D:\a\VirtualScoreCard\VirtualScoreCard\GolfScoreAPI\appsettings.Development.json, D:\a\VirtualScoreCard\VirtualScoreCard\GolfScoreUI\appsettings.Development.json, D:\a\VirtualScoreCard\VirtualScoreCard\GolfScoreAPI\appsettings.json, D:\a\VirtualScoreCard\VirtualScoreCard\GolfScoreUI\appsettings.json. [D:\a\VirtualScoreCard\VirtualScoreCard\UnitTests\UnitTests.csproj]

So it appears that it is somehow trying to push all the projects into the same folder. But how do I get it to build the UI and API to different web apps? And why is it also complaining about the unit tests, when it worked before the API was added?

You can see the yaml file in my github repo.

Jakob Busk Sørensen
  • 5,599
  • 7
  • 44
  • 96
  • Does this answer your question? [Publish error: Found multiple publish output files with the same relative path](https://stackoverflow.com/questions/69919664/publish-error-found-multiple-publish-output-files-with-the-same-relative-path) – Ecstasy Feb 07 '22 at 07:00
  • You can refer to similar issues: [.NET Core 6 Found multiple publish output files with the same relative path](https://github.com/dotnet/sdk/issues/22716) and [Publish errors with multiple files with same relative paths](https://github.com/dotnet/aspnetcore/issues/34142) – Ecstasy Feb 07 '22 at 07:02
  • @DeepDave-MT but why did it work when I had the UI and Unit Test at the same time? The only thing I changed was to add a third project, the API. Also I still need to figure out how to build them to different Web Apps. I don't want to exclude any files, but in the end, it shouldn't matter, as they shouldn't end up in the same app. They just share the repo/solution. – Jakob Busk Sørensen Feb 07 '22 at 07:10

0 Answers0