Steve Michelotti

C#, ASP.NET, and other stuff

  Home  |   Contact  |   Syndication    |   Login
  51 Posts | 1 Stories | 155 Comments | 52 Trackbacks

News



Tag Cloud


Archives

Post Categories

Image Galleries

Articles

Blogs

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

Feedback

# re: Error MSB6006: "aspnet_merge.exe" exited with code 1 - Web Deployment Project 8/3/2006 6:31 AM C. Woody Butler
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

# re: Error MSB6006: "aspnet_merge.exe" exited with code 1 - Web Deployment Project 9/4/2006 12:40 AM Mikael Henriksson
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.

# asp.net 2.0 Error: 'Title' is not a member of 'ASP… 1/11/2007 9:01 AM Emad's Blog
I had this error come up on a few pages after I deployed my website and it was driving me crazy. After

# re: Error MSB6006: "aspnet_merge.exe" exited with code 1 - Web Deployment Project 1/15/2007 1:59 PM Pedro Carvalho
Thanks. i started getting this error and this post helped a lot

Pedro

# re: Error MSB6006: "aspnet_merge.exe" exited with code 1 - Web Deployment Project 2/17/2007 3:55 AM Abdeljawad
this is really helpfull, thankyou

# re: Error MSB6006: "aspnet_merge.exe" exited with code 1 - Web Deployment Project 3/9/2007 3:26 AM Markus
Yes, thanks man! This helped me alot, too!

# re: Error MSB6006: "aspnet_merge.exe" exited with code 1 - Web Deployment Project 3/19/2007 10:34 PM jake
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.

# re: Error MSB6006: "aspnet_merge.exe" exited with code 1 - Web Deployment Project 5/11/2007 5:38 AM Rajnikant
thanks steve it is very helpful.

# re: Error MSB6006: "aspnet_merge.exe" exited with code 1 - Web Deployment Project 6/22/2007 10:23 AM Andres Martinez
Thank you i was going mad with that fucking error

# re: Error MSB6006: "aspnet_merge.exe" exited with code 1 - Web Deployment Project 6/22/2007 11:37 AM Alex Ruggeri
Perfect! This post it is very helpful. Thanks Steve.

# re: Error MSB6006: "aspnet_merge.exe" exited with code 1 - Web Deployment Project 6/29/2007 10:06 AM b0rg
Thanks Steve!
very helpful :)

# re: Error MSB6006: "aspnet_merge.exe" exited with code 1 - Web Deployment Project 7/2/2007 5:19 AM Lisandro Pacheco
Thanks! very helpfull post

# re: Error MSB6006: Index was outside the bounds of the array 7/4/2007 5:46 AM woolfs
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!!!

# re: Error MSB6006: "aspnet_merge.exe" exited with code 1 - Web Deployment Project 7/5/2007 4:11 PM Stefan Mai
Appreciate it, same problem same solution!

# re: Error MSB6006: "aspnet_merge.exe" exited with code 1 - Web Deployment Project 7/22/2007 10:36 PM xiaojie gai
thanks!


# re: Error MSB6006: "aspnet_merge.exe" exited with code 1 - Web Deployment Project 7/23/2007 4:07 AM shiva prasad anand
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


# re: Error MSB6006: "aspnet_merge.exe" exited with code 1 - Web Deployment Project 7/23/2007 10:33 AM Mahendar
tahnks alot..this really helped me alot

# re: Error MSB6006: "aspnet_merge.exe" exited with code 1 - Web Deployment Project 7/24/2007 11:08 PM shiva prasad anand
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.



# re: Error MSB6006: "aspnet_merge.exe" exited with code 1 - Web Deployment Project 8/1/2007 11:20 AM Santhosh
same problem, solution was very helpful, thanks a lot.

# re: Error MSB6006: "aspnet_merge.exe" exited with code 1 - Web Deployment Project 9/27/2007 12:12 PM ngo huy
Same problem, but i can not solve it, i use vs 2005sp1 under vista Can someone help me please?
my email: rosekillerus@yahoo.com

# re: Error MSB6006: "aspnet_merge.exe" exited with code 1 - Web Deployment Project 9/27/2007 12:38 PM Ngo huy
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.

# the command exoted with code 1 10/16/2007 6:39 AM Khushi
Please help for above error while building the solution.

# re: Error MSB6006: "aspnet_merge.exe" exited with code 1 - Web Deployment Project 10/30/2007 12:44 AM Tom
Check out this URL to forums.asp.net. The setting change under Output Assemblies eliminated the error for me:
Link to forum site: http://forums.asp.net/p/956707/1178593.aspx#1178593 Section that describes the “output assemblies” setting change

# re: Error MSB6006: "aspnet_merge.exe" exited with code 1 - Web Deployment Project 11/8/2007 3:47 AM jab
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.

# re: Error MSB6006: "aspnet_merge.exe" exited with code 1 - Web Deployment Project 1/15/2008 2:54 AM Mintu
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?

# re: Error MSB6006: "aspnet_merge.exe" exited with code 1 - Web Deployment Project 1/15/2008 8:38 AM Steve
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.

# re: Error MSB6006: "aspnet_merge.exe" exited with code 1 - Web Deployment Project 1/22/2008 9:42 AM dotnet
It helps so much.

# re: Error MSB6006: "aspnet_merge.exe" exited with code 1 - Web Deployment Project 1/22/2008 1:02 PM AppreciateIt
Brill - thanks a lot - why can't the error msg be more damn helpful !

# re: Error MSB6006: "aspnet_merge.exe" exited with code 1 - Web Deployment Project 1/29/2008 3:50 AM nilesh
Hi Experts,
i am requesting all the people please discribe the solution how you solved the problem.

# re: Error MSB6006: "aspnet_merge.exe" exited with code 1 - Web Deployment Project 1/30/2008 4:46 AM Alejandro
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!

# re: Error MSB6006: "aspnet_merge.exe" exited with code 1 - Web Deployment Project 2/6/2008 5:46 PM Michael
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

# re: Error MSB6006: "aspnet_merge.exe" exited with code 1 - Web Deployment Project 3/14/2008 10:23 AM Ravi Kura
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.

# re: Error MSB6006: "aspnet_merge.exe" exited with code 1 - Web Deployment Project 3/18/2008 10:30 AM Jules Wensley
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

# re: Error MSB6006: "aspnet_merge.exe" exited with code 1 - Web Deployment Project 4/22/2008 6:12 AM Volker
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

# re: Error MSB6006: "aspnet_merge.exe" exited with code 1 - Web Deployment Project 5/16/2008 4:29 AM Madhu
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!!!!!!!!!!

# re: Error MSB6006: "aspnet_merge.exe" exited with code 1 - Web Deployment Project 5/16/2008 5:52 AM Waldy
I tried changing the output verbosity, but it made no difference whatsoever to the error text.

# re: Error MSB6006: "aspnet_merge.exe" exited with code 1 - Web Deployment Project 5/16/2008 10:34 AM Tallion
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.

# re: Error MSB6006: "aspnet_merge.exe" exited with code 1 - Web Deployment Project 7/22/2008 3:53 AM Nripin Babu
You are a life saver lol :)

# re: Error MSB6006: "aspnet_merge.exe" exited with code 1 - Web Deployment Project 7/29/2008 11:59 AM dharma
Yes this solved my problem

# re: Error MSB6006: "aspnet_merge.exe" exited with code 1 - Web Deployment Project 9/24/2008 11:26 AM Nitin
Thanks, It was very helpful.

# re: Error MSB6006: "aspnet_merge.exe" exited with code 1 - Web Deployment Project 10/2/2008 11:13 AM neonprimetime
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.

Post Feedback

Title:
Name:
Email: (never displayed)
Url:
Comments: 
Please add 3 and 5 and type the answer here: