How to fix: error MSB6006: “aspnet_merge.exe” exited with code 1

One of the most annoying Visual Studio errors are the ones that don’t give you any details of what is wrong. This is one of those errors:

error MSB6006: "aspnet_merge.exe" exited with code 1

To fix it open a command line at the root of your project and enter this command:

msbuild /verbosity:detailed > output.txt

Now open output.txt and search for “MSB6006”. You’ll probably see the error right above the error line. This is the error that I usually get:

An error occurred when merging assemblies: ILMerge.Merge: ERROR!!: Duplicate type '' found in assembly 'App_Web_b6it0-k1'.

Usually when I get this error it is because I copied some files to create new pages but forgot to rename the classes. This causes naming conflicts because there are multiple classes with the same name. Just search your code for and you will probably find it defined in multiple places.

This entry was posted in Software and tagged . Bookmark the permalink.

Leave a Reply

Your email address will not be published.