Having received the following error in Visual Studio a few times I thought I’d post the solution here.

I did have debug enabled and seemingly nothing i changed would stop the error. Many of the solutions found when first searching didn’t work, what I had to do was to delete all files from the following directory:

C:\Users\[username]\AppData\Local\temp\Temporary ASP.NET Files