found multiple publish output files with the same relative path "Conflict resolution target" Publishing AspNet 6 in Visual Studio 2022

Question: How do you resolve the error that says "found multiple publish output files with the same relative path" and it goes on stating that "Conflict resolution target" Microsoft.Net 6 when publishing an application in Visual Studio 2022 and Asp.Net 6.

Answer: Dig around and you will find that you have multiple DLL's in one of your Referenced Library Projects, if you have DLL's in the published folder located in the bin directory and then attempt to publish the same DLL's or just any files, Visual Studio 2022 will throw an error because the files will be duplicated.

Generated Errors for duplicate files in the publish output will cause errors in production since the C# Compiler would not know which file to use.

In order to solve this error, back up your files that are causing the exception/error then remove them from the project. Once this is done, build and clean your project then try to publish again.

Let me know in the comments below if this works for you.


Edit this Article
Conflict resolution target Publishing AspNet 6 App in Docker Container Visual Studio 2022 Publish error ebook e-book .NET 6 published
Was this page helpful?
Yes Yes! this solution to the problem was helpful. No No! this solution to the problem was not helpful.. Leave ErnesTech Feedback.Feedback
If you log in, you will be notified when someone leaves a comment.

Other users would like to know if this solution helped you.

Your Session is Ending
Login to Continue

© 2021 - ErnesTech - Privacy