Compiler Error Message: CS0433 in ASP.NET
I got this error today and it made no sense at all:
The type 'some_class_name' exists in both 'some_temp.dll' and 'some_other_temp.dll'
The only change I’d made was to some css.
Here’s how I got the error: I had made some changes to a particular user control before I figured out that the layout problem was in the css. I didn’t want to lose my changes, just in case I needed them, so I made copies of the ascx file and its designer file. Then I reverted all changes, modified the css and ran the web site – clang! The error happened.
After googling it, shutting down the VS web server, clearing out the temp ASP.NET folder, cleaning the solution in Visual Studio, rebuilding, rebooting, etc., etc., and nothing working, I finally figured it out.
It was the copies of the files. Despite the fact that the copies were NOT part of the project, the VS web server was compiling them. So of course there were classes with duplicate names.
Once the copies were removed the web site ran fine.