Old thread but wanted to add in another instance where this issue occurred. Was delaing with a project that was converted from website to web application in Visual Studio 2010. I started to get the type "class" exists in both .../temporary ASP.NET/...yada...yada...yada.
In my case, the old page used a datagrid to display a list of dates but the dataset was a list of classes List<MyClass>
and the code in the .aspx (not code behind) was using the methodology of casting the data item for display...
<%# ((MyClass)Container.DataItem).MyDate %>
For some reason, MyClass was triggering the type error. After doing the full search throughout the project for any possible double class references and the like, did not find anything so basically decided to see if I got rid of the cast and just go with standard method of getting the value from the DataItem as follows:
<%# DataBinder.Eval(Container.DataItem, "MyDate").ToString()%>
And voila...no more type exists error. Not too sure why this would cause the above error to manifest itself (and if anyone has any insight, it would be appreciated) but the problem is gone...
Hope this helps someone...
Dave