Posts
208
Comments
1144
Trackbacks
51
Error MSB6006: "aspnet_merge.exe" exited with code 1 - Web Deployment Project

This error often rears its ugly head when compiling an ASP.NET 2.0 Web Deployment Project.  At first glance, it is extremely difficult to troubleshoot because there is not much information along with the error.  In order to troubleshoot this, you need to use a higher level of verbosity.  If you're using MSBuild from the command line you can use the /verbosity switch like this (and then look at Output window for build):

C:\projects>msbuild YourSolutionFile.sln /t:Rebuild /p:Configuration=Release /verbosity:detailed

If you're using Visual Studio, then you can set Tools - Options like this:

Typically the problem is that when aspnet_merge merges the entire web project into a single assembly, you might find naming collisions.  By default, asp.net 2005 web site applications do not put a default namespace in the class files so if you create MyPage.aspx in the root and also in a sub-folder, this would causes a conflict when merged into a single assembly for the Release build.  This problem would not manifest itself during development because you're not pre-compiling the entire web site into a single DLL so there are several DLLs that make up the web project and naming collisions are avoided.  To fix the problem you can obviously either rename one of the classes or provide a namespace to avoid the conflict.

posted on Monday, July 31, 2006 6:47 PM Print
Comments
Gravatar
# re: Error MSB6006: "aspnet_merge.exe" exited with code 1 - Web Deployment Project
C. Woody Butler
8/3/2006 6:31 AM
Gotta love "verbosity" - only a programmer would think to name a switch verbosity rather than use the more normal "verbose" or something even less arcane like "detaillevel".

thanks steve that's very helpful.

--woody
Gravatar
# re: Error MSB6006: "aspnet_merge.exe" exited with code 1 - Web Deployment Project
Mikael Henriksson
9/4/2006 12:40 AM
thanks steve, as always your posts are very helpful.

The solution to my problem was that I had 2 pages using the same partial class.
Gravatar
# asp.net 2.0 Error: 'Title' is not a member of 'ASP…
Emad's Blog
1/11/2007 9:01 AM
I had this error come up on a few pages after I deployed my website and it was driving me crazy. After
Gravatar
# re: Error MSB6006: "aspnet_merge.exe" exited with code 1 - Web Deployment Project
Pedro Carvalho
1/15/2007 1:59 PM
Thanks. i started getting this error and this post helped a lot

Pedro
Gravatar
# re: Error MSB6006: "aspnet_merge.exe" exited with code 1 - Web Deployment Project
Abdeljawad
2/17/2007 3:55 AM
this is really helpfull, thankyou
Gravatar
# re: Error MSB6006: "aspnet_merge.exe" exited with code 1 - Web Deployment Project
Markus
3/9/2007 3:26 AM
Yes, thanks man! This helped me alot, too!
Gravatar
# re: Error MSB6006: "aspnet_merge.exe" exited with code 1 - Web Deployment Project
jake
3/19/2007 10:34 PM
I had this problem because I had an assemblyInfo.cs file in my webservice project. The web deployment build didn't like it because I had to sign all of my input assemblies, including the web service. When I deleted the assemblyinfo.cs file and used the "property pages" to set the strong name key file, it worked.
Gravatar
# re: Error MSB6006: "aspnet_merge.exe" exited with code 1 - Web Deployment Project
Rajnikant
5/11/2007 5:38 AM
thanks steve it is very helpful.
Gravatar
# re: Error MSB6006: "aspnet_merge.exe" exited with code 1 - Web Deployment Project
Andres Martinez
6/22/2007 10:23 AM
Thank you i was going mad with that fucking error
Gravatar
# re: Error MSB6006: "aspnet_merge.exe" exited with code 1 - Web Deployment Project
Alex Ruggeri
6/22/2007 11:37 AM
Perfect! This post it is very helpful. Thanks Steve.
Gravatar
# re: Error MSB6006: "aspnet_merge.exe" exited with code 1 - Web Deployment Project
b0rg
6/29/2007 10:06 AM
Thanks Steve!
very helpful :)
Gravatar
# re: Error MSB6006: "aspnet_merge.exe" exited with code 1 - Web Deployment Project
Lisandro Pacheco
7/2/2007 5:19 AM
Thanks! very helpfull post
Gravatar
# re: Error MSB6006: Index was outside the bounds of the array
woolfs
7/4/2007 5:46 AM
I had this problem too..., but build otput message speak - "Index was outside the bounds of the array"

Using "AspNetMerge" task from assembly "C:\Program Files\MSBuild\Microsoft\WebDeployment\v8.0\Microsoft.WebDeployment.Tasks.dll".
Task "AspNetMerge"
Running aspnet_merge.exe ...
Command:
path_util_merge\aspnet_merge.exe path_project\WebOperatorServiceDeploy\Release -o WebOperatorServiceDepl -copyattrs path_project\WebOperatorServiceDeploy\AssemblyInfo\Release\AssemblyInfo.dll
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: Index was outside the bounds of the array.
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.
Done building target "AspNetMerge" in project "WebOperatorServiceDeploy.wdproj" -- FAILED......
I review all inet, but has not found decisions!
HELP PLEASE!!!
Gravatar
# re: Error MSB6006: "aspnet_merge.exe" exited with code 1 - Web Deployment Project
Stefan Mai
7/5/2007 4:11 PM
Appreciate it, same problem same solution!
Gravatar
# re: Error MSB6006: "aspnet_merge.exe" exited with code 1 - Web Deployment Project
xiaojie gai
7/22/2007 10:36 PM
thanks!
Gravatar
# re: Error MSB6006: "aspnet_merge.exe" exited with code 1 - Web Deployment Project
shiva prasad anand
7/23/2007 4:07 AM
hi Experts.

just like jake , Mikael Henriksson please discribe the solution how you solved the problem.. it will help to so many developers
please i am requesting the all the people to do the same.

for jake :
hi jake ,how r u , my doubt is how you find that is only the problem (assemblyInfo.cs) can u give me the solution please


once again i am requesting all the people please discribe the solution how you solved the problem.. it will help to so many developers
Gravatar
# re: Error MSB6006: "aspnet_merge.exe" exited with code 1 - Web Deployment Project
Mahendar
7/23/2007 10:33 AM
tahnks alot..this really helped me alot
Gravatar
# re: Error MSB6006: "aspnet_merge.exe" exited with code 1 - Web Deployment Project
shiva prasad anand
7/24/2007 11:08 PM
Thanks Stev

This is really helped me a lot

to know which name spaces are having the same name check in output window it displays the problems in detail.

Gravatar
# re: Error MSB6006: "aspnet_merge.exe" exited with code 1 - Web Deployment Project
Santhosh
8/1/2007 11:20 AM
same problem, solution was very helpful, thanks a lot.
Gravatar
# re: Error MSB6006: "aspnet_merge.exe" exited with code 1 - Web Deployment Project
ngo huy
9/27/2007 12:12 PM
Same problem, but i can not solve it, i use vs 2005sp1 under vista Can someone help me please?
my email: rosekillerus@yahoo.com
Gravatar
# re: Error MSB6006: "aspnet_merge.exe" exited with code 1 - Web Deployment Project
Ngo huy
9/27/2007 12:38 PM
i was solved my problem. This error occur when in project have 2 page have same class name. Sometime we create a page and change it's name but we don't change class name of it. in my case, i create a page and change it to login.aspx, and create name page, all of it have class name _default. i only change class name of login page to _login. it very easy.
Gravatar
# the command exoted with code 1
Khushi
10/16/2007 6:39 AM
Please help for above error while building the solution.
Gravatar
# re: Error MSB6006: "aspnet_merge.exe" exited with code 1 - Web Deployment Project
jab
11/8/2007 3:47 AM
Problem is when two page has same class name but take care than all aspx in the folder are compiled and not only aspx present in the solution. If you do a copy of an aspx page, the copy must be outside the folder.
Gravatar
# re: Error MSB6006: "aspnet_merge.exe" exited with code 1 - Web Deployment Project
Mintu
1/15/2008 2:54 AM
Thanks steve,
it is very helpful.
the problem with my appliation is same (multiple pages with same partial class name), But I dont want to change the class name as this is not in my hand.
In fact i can not change anything in the code. I just have the build the given code using MSbuild.
In that case what can be the posible solution?
Gravatar
# re: Error MSB6006: "aspnet_merge.exe" exited with code 1 - Web Deployment Project
Steve
1/15/2008 8:38 AM
Mintu - In your case, I'd suggest trying to compile your web site into multiple assemblies via the Web Deployment project rather than trying to merge them all into a single assembly.
Gravatar
# re: Error MSB6006: "aspnet_merge.exe" exited with code 1 - Web Deployment Project
dotnet
1/22/2008 9:42 AM
It helps so much.
Gravatar
# re: Error MSB6006: "aspnet_merge.exe" exited with code 1 - Web Deployment Project
AppreciateIt
1/22/2008 1:02 PM
Brill - thanks a lot - why can't the error msg be more damn helpful !
Gravatar
# re: Error MSB6006: "aspnet_merge.exe" exited with code 1 - Web Deployment Project
nilesh
1/29/2008 3:50 AM
Hi Experts,
i am requesting all the people please discribe the solution how you solved the problem.
Gravatar
# re: Error MSB6006: "aspnet_merge.exe" exited with code 1 - Web Deployment Project
Alejandro
1/30/2008 4:46 AM
Thanks! Very helpful... My error was due to SourceSafe... IF I DELETE A FILE, I WANT DELETE IT... why do you restore it? Doh...

Bye!
Gravatar
# re: Error MSB6006: "aspnet_merge.exe" exited with code 1 - Web Deployment Project
Michael
2/6/2008 5:46 PM
God I love the internet. I could have spent days on this problem. Thank you for posting a solution! Now, if MS could have added a little more detail to the error message...

Mike
Gravatar
# re: Error MSB6006: "aspnet_merge.exe" exited with code 1 - Web Deployment Project
Ravi Kura
3/14/2008 10:23 AM
Thanks for this Post. This post has saved me wasting one day in resolving this issue. In My case i have copy pasted (backed up) the both aspx & aspx.cs in same folder in solution. once i removed these 2 files it started working.

Thanks,
Ravi Kura.
Gravatar
# re: Error MSB6006: "aspnet_merge.exe" exited with code 1 - Web Deployment Project
Jules Wensley
3/18/2008 10:30 AM
Thank you so much for this post - it's my own bloody stupid fault two years ago as I was cutting and pasting. Since learnt my lesson.

Cheers
Jules
Gravatar
# re: Error MSB6006: "aspnet_merge.exe" exited with code 1 - Web Deployment Project
Volker
4/22/2008 6:12 AM
Hi,

thank you for this small but very helpful hint.

I also had the problem with this:
An error occurred when merging assemblies: Index was outside the bounds of the array.

My solution... or I should say my fault was using an outdated WebDeploymentSetup. Don't know if this helps the others here, but after installing the newer setup from 04.04.2006 my solution merged successful.

cu
Volker
Gravatar
# re: Error MSB6006: "aspnet_merge.exe" exited with code 1 - Web Deployment Project
Madhu
5/16/2008 4:29 AM
Can anybody tell how do u find out, there are duplicate file names used....

I have a large application but and hence have no time to find it out!!!!!!!!!!
Gravatar
# re: Error MSB6006: "aspnet_merge.exe" exited with code 1 - Web Deployment Project
Waldy
5/16/2008 5:52 AM
I tried changing the output verbosity, but it made no difference whatsoever to the error text.
Gravatar
# re: Error MSB6006: "aspnet_merge.exe" exited with code 1 - Web Deployment Project
Tallion
5/16/2008 10:34 AM
I went into safe source and renamed a folder and reopened the project. the project had both folders the old and the new folder. the deploy project did not like this. i deleted the old folder and all was good again.
Gravatar
# re: Error MSB6006: "aspnet_merge.exe" exited with code 1 - Web Deployment Project
Nripin Babu
7/22/2008 3:53 AM
You are a life saver lol :)
Gravatar
# re: Error MSB6006: "aspnet_merge.exe" exited with code 1 - Web Deployment Project
dharma
7/29/2008 11:59 AM
Yes this solved my problem
Gravatar
# re: Error MSB6006: "aspnet_merge.exe" exited with code 1 - Web Deployment Project
Nitin
9/24/2008 11:26 AM
Thanks, It was very helpful.
Gravatar
# re: Error MSB6006: "aspnet_merge.exe" exited with code 1 - Web Deployment Project
neonprimetime
10/2/2008 11:13 AM
How I resolved this problem: I had 2 aspx files with code behinds that had the same class name (Example: Error.aspx in 2 different folders) ... I had to rename one of the classes to something like "Error2" and then it worked.
Gravatar
# re: Error MSB6006: "aspnet_merge.exe" exited with code 1 - Web Deployment Project
Rajwant Singh
10/20/2008 8:40 AM
Just goto your Solution Explorer in Visual Studio 2005
Right Click on your Web development project and Select 'Propert Pages'.

In Configuration Properties - select Output Assemblies.
On the right side - Select "Create a Seperate Assembly for each page and Control Output"

Use this solution only if a DLL for each page is OK with you ppl.


Gravatar
# re: Error MSB6006: "aspnet_merge.exe" exited with code 1 - Web Deployment Project
Joe Herr
1/15/2009 5:02 PM
Thanks, that was a big help.
Gravatar
# re: Error MSB6006: "aspnet_merge.exe" exited with code 1 - Web Deployment Project
Duncan
5/28/2009 10:47 PM
Fantastic! I searched the Web for a couple of hours last night but when I tried again tonight I immediately found your post. As my site is not that complicated, I took a shot in the dark as to which function might be causing the problem. Renamed the function. Got it on the first try! (I also won a botle of Sangiovese at our Chamber of Commerce get together earlier this evening so I about to run out and buy a lottery ticket! <g>) Thanks for taking the time to post this incredibly helpful guide to fixing what can be a truly perplexing problem!

Duncan
Gravatar
# re: Error MSB6006: "aspnet_merge.exe" exited with code 1 - Web Deployment Project
Jessy
11/11/2009 4:45 AM
I tried the solution you have given.. The problem is i couldn't find the output assemblies in my visual studio 2005.

Please help me..
Gravatar
# re: Error MSB6006: "aspnet_merge.exe" exited with code 1 - Web Deployment Project
Steve
11/11/2009 9:30 AM
@Jessy - I'm not following you when you say you couldn't find your output assemblies. Are you getting the error message described in this post? If so, did you increase verbosity so you could see a more specific error message?
Gravatar
# re: Error MSB6006: "aspnet_merge.exe" exited with code 1 - Web Deployment Project
raven
11/16/2009 11:52 AM
Yes thanks Steve!! I could not figure out why this was happening and now problem solved!
Gravatar
# re: Error MSB6006: "aspnet_merge.exe" exited with code 1 - Web Deployment Project
Dhiren
4/26/2010 2:03 PM
Thank you very much. Your post really helped me to recognize the actual problem.

thank.
Gravatar
# re: Error MSB6006: "aspnet_merge.exe" exited with code 1 - Web Deployment Project
Serge
8/5/2010 9:06 PM
Thanks helped me resolved the problem quickly
Gravatar
# re: Error MSB6006: "aspnet_merge.exe" exited with code 1 - Web Deployment Project
Nazeer Palakkaparambil
8/31/2010 6:29 AM
In my case, I had an aspx page xyz.aspx, backed up into backup_xyz.aspx which somehow got added into my project and got conflicted (due to duplication) with my original xyz.aspx file. Steve's note really helped me to find it out. Thank you Steve!
Gravatar
# re: Error MSB6006: "aspnet_merge.exe" exited with code 1 - Web Deployment Project
Karthikeyan
11/22/2013 8:44 AM
i am also same problem and fix it
solution
The multiple class occur in same name
eg.class xxx occur in two time
Remove that class ,and Build it

Post Comment

Title *
Name *
Email
Comment *  
Verification

View Steve Michelotti's profile on LinkedIn

profile for Steve Michelotti at Stack Overflow, Q&A for professional and enthusiast programmers




Google My Blog

Tag Cloud