Error: The type exists in both directories

This has been answered in a separate question and resolved the problem for me. Be sure to vote up the original person's answer.

ASP.Net error: "The type 'foo' exists in both "temp1.dll" and "temp2.dll"

Add the batch="false" attribute to the "compilation" element of the web.config file.

This problem occurs because of the way in which ASP.NET 2.0 uses the application references and the folder structure of the application to compile the application. If the batch property of the element in the web.config file for the application is set to true, ASP.NET 2.0 compiles each folder in the application into a separate assembly.

http://www.sellsbrothers.com/news/showTopic.aspx?ixTopic=1995

http://support.microsoft.com/kb/919284


Assuming you're building a Web Application, which it appears you are given the MVC2 point, you shouldn't use the App_Code folder. It was not designed to be integrated with Web Application projects.

When you Compile in Visual Studio, all the code in your application (including in App_Code) gets compiled into an assembly. When you run your application, asp.net knows about a "special" folder called App_Code and compiles the content of it into an assembly with a unique name. Thus, anytime you run the project you'll run into this problem.

The solution:

Rename your App_Code folder to something like "Code" or "Global" (and update your now broken references) & voila, problem solved.


My issue was with different version of DevExpress.
Deleting all contents from bin and obj folders made my website run again...

Reference: https://www.devexpress.com/Support/Center/Question/Details/KA18674


Try cleaning your solution and then try to rebuild. Visual Studio probably still has reference to the old dll after it created the new dll.