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.

Login to See the Rest of the 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.

© 2024 - ErnesTech - Privacy
E-Commerce Return Policy