Today I kept getting a really strange error when I was trying to write some ASP.NET code. I am using a cross-page post-back and was having trouble getting the cast to work, casting the PreviousPage property to my previous page's type as in this line:
string sStart = ((DefaultAspx)PreviousPage).StartDate;
The error I was getting was:
The type 'DefaultAspx' exists in both '{guid}' and '{guid}'
This didn't make a whole lot of sense to me as it was not being referenced anywhere else. I tried a bunch of different things but finally narrowed it down to the files in my VS web cache. After deleting the files in cache folder the error magically disappeared. So for anyone who stumbles across this post, try deleting the files in:
c:\Users\<username>\AppData\Local\Microsoft\WebsiteCache\<websitename>
and
c:\Users\<username>\AppData\Local\Temp\Temporary ASP.NET Files\<websitename>
…and let me know if that worked for you too.
Yet another bunch of time spent on things that shouldn't be.