views:

96

answers:

2

I've moved a class to the App_Code folder and I'm now receiving the following error message:

CS0433: The type 'myProject.App_Code.ItemType' exists in both 'c:\WINDOWS\
Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\8cdcbe9c\
b9695514\assembly\dl3\e5cfe230\82ca7cf7_5c89ca01\myProject.DLL' and 
'c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\
root\8cdcbe9c\b9695514\App_Code.5kpxjdxm.dll'

This error is returned at runtime.

I've searched my application for any duplicate but I'm guessing this is due to something not updating as I expect?

If I move the class back outside of the App_Code folder, everything works again as expected.

What am I missing?

+1  A: 

Have you tried:

  • clearing the referenced Temporary ASP.NET Files folder and restarting Visual Studio ?
ChristopheD
Just tried that and the same problem still exists.
Jamie Dixon
this will resolve this.
this. __curious_geek
close VS first and tehen remove everything from the temp directory and then reload the project.
this. __curious_geek
Try adding `batch='false'` to the compilation element of the web.config.
ChristopheD
Thanks ChristopheD. The same error still shows after doing that though.
Jamie Dixon
A: 

Did you copy the file into app_code instead of moving it? Or have you created a backup copy of the file/page/control?

These could also be reasons for the error message.

M4N
Thanks Martin. I've tried it both ways and both return the same error.
Jamie Dixon