Software⏱️ 3 min read📅 2026-06-04

How to Fix: Where does error CS0433 "Type 'X' already exists in both A.dll and B.dll " come from?

CS0433 error occurs when a type is defined in multiple assemblies.

Quick Answer: The error CS0433 indicates that the same type 'WebApplication3.Site1' is being referenced from both A.dll and B.dll, which are likely generated by ASP.NET's temporary files.

Error CS0433 occurs when you run a web application from Visual Studio 2008 SP1 using its internal web server, resulting in a compiler error message indicating that a type already exists in both A.dll and B.dll. This issue primarily affects developers who use the Visual Studio internal web server for development and testing purposes.

This error can be frustrating because it prevents you from compiling and running your application, making it difficult to identify and fix other issues. Fortunately, there are several steps you can take to resolve this error and get back to working on your project.

🔍 Why This Happens

  • The primary reason for Error CS0433 is the duplication of types in the assembly. When you use the Visual Studio internal web server, it compiles your application into a temporary assembly that includes all referenced DLLs. If two or more types have the same name but different namespaces, the compiler will throw an error because it cannot resolve which type to use.
  • Another possible cause is the incorrect configuration of the Visual Studio internal web server. In some cases, the server may not be configured correctly, leading to the duplication of types and resulting in Error CS0433.

🛠️ Step-by-Step Verified Fixes

Rebuild and Clean the Solution

  1. Step 1: Close any open instances of Visual Studio and restart the application.
  2. Step 2: Go to Build > Rebuild Solution or press Ctrl + Shift + B on your keyboard to rebuild the entire solution from scratch.
  3. Step 3: After rebuilding, go to Build > Clean Solution or press Ctrl + Shift + R on your keyboard to clean the solution by deleting all temporary files and assemblies.

Manually Remove Duplicate Types

  1. Step 1: Open the Project Properties window by right-clicking on the project in Visual Studio and selecting Properties.
  2. Step 2: In the Project Properties window, navigate to the Build tab and click on the 'Add' button next to 'Assembly Name'.
  3. Step 3: Delete any duplicate types from the list of referenced assemblies and try rebuilding the solution.

💡 Conclusion

By following these steps, you should be able to resolve Error CS0433 and get back to working on your project. Remember to regularly clean and rebuild your solution to prevent this error from occurring in the future.

Did this fix your problem?

If not, try searching for specific error codes.

🔍 Search Error Database

❓ Frequently Asked Questions