ASP.NET ILMerge utility error: exit code 1 - target references itself

Share on FacebookI had an error recently which took me a while to figure out and fix, so I thought I would document it here to save someone in a similar situation.

Basically, if you ever have the need to upgrade an ASP.Net 1.1 web application to .Net 2.0 without a full scale redesign of the membership system, ie. user databases, roles etc, then you might have to resort to web application projects as a quick upgrade option.

I found myself in that situation recently while upgrading a .Net 1.1 app based on the IbuySpy portal to .Net 2.0. I went through all the steps necessary to migrate the app from ASP.Net 1.1 to a .Net 2.0 web application project. I was using Visual Studio 2005 with web application projects and web deployment projects. (This article is not meant to explain either of these tools, simply the error above)
When I tried to build the solution to produce the deployment files and a single assembly, the asp.net compiler compiled successfully, but the Ilmerge utility supposed to combine the assemblies into one kept throwing out with an exit code 1 and a message similar to "target assembly  references itself". I searched the web and tried setting verbosity to diagnostic in tools/options with no explanation as to the source of the error.

Finally, the solution was to rename the combined assembly in the web deployment project differently from the output assembly name in project properties. With this fix, two dlls get generated in the bin folder of the web deployment project output directory, discard the dll with the name equal to the web deployment project target assembly and use the dll with name equal to that specified in the actual project properties.

Well that's it, I had to rush this, but I hope it makes sense, granting you know what you are doing. Hope it helps you out and saves you some minutes!!
Digg It!DZone It!StumbleUponTechnoratiRedditDel.icio.usNewsVineFurlBlinkListkick it on DotNetKicks.comTwitThis

Comments

Comments are closed

About Me

When not scratching my head for solutions to software challenges, I spend my time playing with my little boy - Michael Jnr.

Quotations

"Every day I remind myself that my inner and outer life are based on the labors of other men, living and dead, and that I must exert myself in order to give in the same measure as I have received and am still receiving"
Albert Einstein

Donate with PayPal - it

Calendar

<<  July 2010  >>
MoTuWeThFrSaSu
2829301234
567891011
12131415161718
19202122232425
2627282930311
2345678

View posts in large calendar

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2005 - 2010

Search