The Asp.net compilation Error Type "also exists in" different DLL (Summary)

Source: Internet
Author: User

This problem is often encountered in projects, so we can summarize it and write it down:

There are three possible causes of this error:

1. ASPX page, a *. aspx corresponds to a *. CS file. The two are actually a file.CodeSeparation, each *. ASPX page references its own CS file: if the two pages reference the same. CS file, this error will also occur during release.

2,
It is estimated that there is an old version of DLL in the bin, and the new version of DLL name is replaced, the new cannot overwrite the old one, and it exists in the bin, this may happen.
Solution: manually delete the files in the bin. C: \ Windows \ Microsoft. NET \ framework \ version \ temporary
In the temporary files of ASP. NET files, delete the corresponding directories and re-compile and run the files. Remember to manually delete the components under the bin directory.

  

3. I just met this situation: the control name and reference control page have the same name. Although there is no error during compilation, a prompt will be prompted when the control is released.

I remembered that I added an ashx from other website projects through "add existing items" during this period, so I checked this file carefully, the namespace in the CS file has been changed to the default namespace of my project,
However, the ashx file is not changed, and the namespace of the original project is retained (the ashx file only has one header Declaration, so double-click the ashx file in vs to open its CS file directly, export
To easily ignore this file ).

After the modification, the compilation error cs0433 is no longer displayed.

This problem is often encountered in projects, so we can summarize it and write it down:

There are three possible causes of this error:

1. ASPX page, *. aspx corresponds to *. CS file, the two are actually a file, the code is separated by the two, each *. aspx pages reference their own CS files: if the two pages reference the same. this error occurs when the CS file is published.

2,
It is estimated that there is an old version of DLL in the bin, and the new version of DLL name is replaced, the new cannot overwrite the old one, and it exists in the bin, this may happen.
Solution: manually delete the files in the bin. C: \ Windows \ Microsoft. NET \ framework \ version \ temporary
In the temporary files of ASP. NET files, delete the corresponding directories and re-compile and run the files. Remember to manually delete the components under the bin directory.

  

3. I just met this situation: the control name and reference control page have the same name. Although there is no error during compilation, a prompt will be prompted when the control is released.

I remembered that I added an ashx from other website projects through "add existing items" during this period, so I checked this file carefully, the namespace in the CS file has been changed to the default namespace of my project,
However, the ashx file is not changed, and the namespace of the original project is retained (the ashx file only has one header Declaration, so double-click the ashx file in vs to open its CS file directly, export
To easily ignore this file ).

After the modification, the compilation error cs0433 is no longer displayed.

Related Article

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.