Also talk about ASP. Net compilation error cs0433 Type xxx at the same time...

Source: Internet
Author: User

The ASP. NET project has been well developed, and this problem suddenly occurs in the evening. So I searched for it and found someone providing a better solution:

Http://www.cnblogs.com/chinhr/archive/2008/08/08/1263508.html

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, while the new version of DLL name is replaced, and the new version cannot be replaced, and the new version is stored in the bin, this may happen. solution: manually delete the items in the bin, c: \ windows \ Microsoft. net \ framework \ version \ temporary ASP.. Net files. remember to manually delete 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.

And a supplementary explanation:

If your user control name is different, but the value of the classname attribute in the control command is the same, the above error will also occur.

My project was being repaired and debugged all afternoon, so I knew that there were no repeated class references in my project.

In addition, this is a strange situation: it has been declared that a user control has errors at the same time, but it was compiled successfully at a retry, and then did not go to several pages, another user control is reported to have an error at the same time. After that, the compilation fails again, and the original user control error is reported.

I think this error is purely an error, so I think it is caused by an internal error in Visual Studio. So I tried to clear the cache, clear the bin, clear the OBJ, and re-compile the command in, even restarting the computer won't work, and it's an hour before and after a while, And it's furious.

Then I decided to find the version of the backup in the afternoon for testing. Once the backup was successful, the error was locked to the difference between the two versions.

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

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

This is caused by small personal mistakes, but ASP. net error prompt is like a crazy dog, it seriously mislead and interfere with developers to solve the problem, hope ASP. the development team of net can fix this problem and reduce similar mistakes in the future.

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.