The Temporary ASP.NET Files folder (located at C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\) is effectively an assembly cache for things that you compile. When using dynamic compilation (or any time you are debugging through Visual Studio), it is here where those temporary assemblies get stored.
The problem is after you start compiling a bunch and you make a bunch of changes, you may find that your site was building successfully a few minutes ago and now you are getting some random error mentioning a DLL in the Temporary ASP.NET files folder. Once you get this error, there is nothing you can do in Visual Studio to fix it.
Here is what you have to do.
- Close Visual Studio 2005.
- Kill the ASP.NET worker process aspnet_wp.exe.
- Go to the Temporary ASP.NET Files folder and delete everything inside it.
- Restart Visual Studio 2005.
- Build the Web Site.
The first two steps are required because usually at least one of those DLLs is in memory and can't be deleted. Hopefully, this will help you with this issue when it comes up for you.
Read the complete post at http://www.dotnettipoftheday.com/blog.aspx?id=23