15 January 2007

aspnet_merge.exe" exited with code 1

I just finished writing my last post and since I mentioned "web deployment project", I think I need to blog this error that i encountered during compilation as well.

Basically, this means you have duplicated files in your source code and at first glance, you won't have a clue as to which ones. It's a headache if you are like me, have hundreds of files.

To enable it, you have to make the compiler to spit out a detailed output, to do that (in vs2005), go to Tools->Options(make sure "show all settings" is checked on the left bottom)->Projects and Solutions->Build and Run-> and under the "MSBuild project build output verbosity:" dropdown list, select "detailed" or "diagnostic" option.

Re-compile your deployment project and you shall see exactly what happened to you.

For example, here is what turns up in my "diagnostic" menu

 Running aspnet_merge.exe ...
    Command:
    C:\Program Files\MSBuild\Microsoft\WebDeployment\v8.0\aspnet_merge.exe D:\Websites\Civion\Projects\PM1\WebDeployment\PMSite_deploy\FreeTrial -o PMSite_deploy -copyattrs
    The "AspNetMerge" task is using "aspnet_merge.exe" from "C:\Program Files\MSBuild\Microsoft\WebDeployment\v8.0\aspnet_merge.exe".
    Utility to merge precompiled ASP.NET assemblies.
    Copyright (c) Microsoft Corporation. All rights reserved.
   
    An error occurred when merging assemblies: ILMerge.Merge: ERROR!!: Duplicate type 'mytiddly' found in assembly 'App_Web_u7us-dft'.
    C:\Program Files\MSBuild\Microsoft\WebDeployment\v8.0\Microsoft.WebDeployment.targets(574,9): error MSB6006: "aspnet_merge.exe" exited with code 1.
  Done executing task "AspNetMerge" -- FAILED.


I have a copy of "mytiddly.aspx" in my folder, oops, so I should exclude the copy and recompile, voilla, everything now is fine.
Filed under:
 
Anonymous comments are disabled