Aspnet_merge.exe has exited. Solution to the error code 1

Source: Internet
Author: User

Webdeployment project plug-in

When the website is published in vs2005, the DLL file generated does not generate the rule like vs2003. The generated DLL file name contains a random number and cannot generate a DLL file for a project. It is a pity that, in order to do the same thing as vs2003, microsoft released the webdeployment project plug-in to solve this problem:

1. After the download is installed, right-click the project in vs2005 and a "add web deployment project" option will appear"

2. Select to add a webdeployment Project (enterProgramSet Name and publishing address)

3. An additional project will be included in the solution.

4. Right-click the project to set the corresponding properties

5. Right-click the project (databind2005) and select "generate". The website will be published to the specified directory, and the DLL file generated will be the same as vs2003.
Upload DLL files

Note: There is another method. After installing SP1 in vs2005, the "ASP. NET web application" will appear in the new project. The DLL file generated by this website is the same as that generated by vs2003. However, if your previous website was created on vs2005, you may need to modify the code in this way.

But always report when publishing
"Aspnet_merge.exe" has exited,Code1 error
In addition, the released dll has not been merged. It is still the same as before, a lot;

I checked it online, some of them said it was about Chinese encoding, and some said it was about an array index exceeding the limit. I can't solve it myself, but where can I find this error;

Fortunately, some people said on the Internet that they would generate and run the VS 2005 tool-options-project and solution-, set "msbuild project generation output details", and select "details ". After the Web deployment projects project is created again, the information in the "output" box becomes very rich. In this way, you can view the errors;

Sure enough, the error stops again.
An error occurred when merging assemblies: ilmerge. Merge: Error !! : Duplicate type 'web _ left' found in assemb' app _ web_k7ytr'

It means that the web_left class already exists. I will search for this string in the project,

Sure enough, it appears four times. The two are defined in the class in the CS file, and the other two are called in the inherits of the page;

Needless to say, this is a programmer who did not make any changes when copying the page, even the CS reference was not changed; I changed it immediately and generated it again;

Again, the prompt is the same as the previous one, but the class name is different. It seems that there are a lot of the same errors. Alas, you have to change it and then generate it. Find the error location according to the prompt and change it; generation was slow. After an afternoon, all the changes were completed;

Finally, it is generated successfully! Haha; all the DLL generated by CS is merged into a DLL;

In the header of the page, the CS reference is changed
<% @ Page Language = "C #" autoeventwireup = "true" inherits = "web_govopen_article, builderweb" enableeventvalidation = "false" viewstateencryptionmode = "never" %>
Note that the referenced DLL name at inherits does not contain a random number;

I also read this information in the "output" Window of vs2005.
Command:
C: \ windows \ Microsoft. net \ framework \ v2.0.50727 \ aspnet_compiler.exe-V/website-P "D: \ Project Phase II \ Website"-u-F-d "D: \ Project Phase II \ builderweb \ webroot \\"
The task "aspnetcompiler" is using "aspnet_compiler.exe" in "c: \ windows \ Microsoft. NET \ framework \ v2.0.50727 \ aspnet_compiler.exe.pdf ".

I'm familiar with it. The original scheme was generated using aspnet_compiler.exe. I used it as a command line;

Next
Running aspnet_merge.exe...
Command:
C: \ Program Files \ msbuild \ Microsoft \ webdeployment \ v8.0 \ aspnet_merge.exe "D: \ Project Phase II \ builderweb \ webroot"-O builderweb-debug-copyattrs
The task "aspnetmerge" is using "C: \ Program Files \ msbuild \ Microsoft \ webdeployment \ v8.0 \ aspnet_merge.exe.exe 的aspnet_merge.exe ".

Ask, the function of aspnet_merge.exe is to merge DLL files;

It is precisely because the CS document referenced by aspx has the same class name, so an error will be reported during the merge. Previously, the classes are separated in different DLL. The duplicate name problem is not exposed, and the merge will cause a problem;

Now we can understand this "error with code 1.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.