asp.net tutorial: Compilation errors exist at the same time in different DLLs

Source: Internet
Author: User
Tags net reference version visual studio
The asp.net compilation error type "exists in" a different DLL. There are probably three cases of this error:

1, aspx page, a *. ASPX, corresponding to a *.cs file, the two are actually a file, through the two code separation, each *.aspx page refers to its own CS file: If two pages refer to the same. cs file, when the publication will also appear this error.

2, it is estimated that there is an old version of the DLL in the bin, and the new edition of the name of the DLL replaced, not to cover the old, and the existence of bin, it is likely to happen this situation. Solution: Delete the bin manually, C:\WINDOWS\Microsoft.NET\Framework\ version number \temporary asp.net files in the temporary file, the corresponding directories are deleted, Then recompile and run it OK. Remember that components in the bin directory must be manually removed

3, I met this situation: the name of the control and the reference control to get the exact name of the page, although the compile time without errors, but when the release will be prompted.

There are probably three cases of this error:

1, aspx page, a *. ASPX, corresponding to a *.cs file, the two are actually a file, through the two code separation, each *.aspx page refers to its own CS file: If two pages refer to the same. cs file, when the publication will also appear this error.

2, it is estimated that there is an old version of the DLL in the bin, and the new edition of the name of the DLL replaced, not to cover the old, and the existence of bin, it is likely to happen this situation. Solution: Delete the bin manually, C:\WINDOWS\Microsoft.NET\Framework\ version number \temporary asp.net files in the temporary file, the corresponding directories are deleted, Then recompile and run it OK. Remember that components in the bin directory must be manually removed

3, I met this situation: the name of the control and the reference control to get the exact name of the page, although the compile time without errors, but when the release will be prompted.

And a supplementary note:

If your user control name is not the same, but the value of the ClassName property in the Controls command will also appear above the error

My project is being repaired and debugged all afternoon, so I am well aware that there are no duplicate class references in my project.

And my situation is bizarre: it has been reported on a user control at the same time there are errors, but a retry was compiled successfully, and then did not turn several pages, and reported another user control errors at the same time, and then again failed to compile success, continue to report the original user control error.

I think this error is purely nonsense, so I decided that Visual Studio internal errors, so tried to clean up the cache, clean bin, clean obj, vs in the clean, recompile command, and even restart the computer, all not, before and after tossing small one head, already is furious.

Then I decided to find the afternoon backup version to test, one success, so I locked the error in the two version of the difference between.

I remembered that I had added a ashx from another Web site project through Add Existing item, so I checked the file and found that the namespace in its CS file has been changed to my project default namespace, but it has not changed in its ashx file. Also retains the original project namespace (ashx file has only one header declaration, so in vs double-click Ashx file is directly open its CS file, resulting in easy to ignore this file).

After correcting it, the compile error CS0433 finally stopped appearing.

Although this is a personal error caused by the problem, but asp.net the wrong tip is like a mad dog bite, seriously misleading, interference developers to solve the problem, hope that ASP.net's development team can fix this problem, and in the future to reduce similar errors.



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.