rf_wilson
rf_wilson

Reputation: 1582

The type 'typename' exists in both App_Code.dll and solution.dll

I have a Visual Studio 2012 solution which includes a Web Application Project plus a number of Class Library Projects. The solution builds successfully in VS but when I browse to an ASPX page I get this error:

Compilation Error

S0433: The type '<type-name>' exists in both
'c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET
Files\root\3e98edf3\c4c22795\App_Code.dll' and
'c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET
Files\root\3e98edf3\c4c22795\assembly\dl3\ef67a753\a19c0f5f_801ecf01\
my-solution.DLL

My Web Application project does not contain an App_Code folder, only an AppCode (note the missing underscore) folder. I inherited this project from another developer so can't find out why it is setup this way.

I have tried clearing my temporary ASP.net files and have Cleaned and Rebuilt the solution.

Upvotes: 1

Views: 6662

Answers (1)

rf_wilson
rf_wilson

Reputation: 1582

Found the problem! When viewing through Windows Explorer, I had an AppCode and an App_Code folder with the same files in each. I guess whoever worked on this before me had created AppCode and somewhere along the way the new App_Code was added.

This is what caused the duplicate type name, one compiled into App_Code.dll and the other into solution.dll

Upvotes: 1

Related Questions