I am getting fed up with this error. I have search all over the web and tried every possible suggestion to this error I could find.
This error was occurring for me when I tried to compile the project with MSBUILD - it would build fine within Visual Studio, and would even Debug in my local browser. The Publish option within VS worked, as well. But the command-line MSBUILD was causing the project to error out every time.
I managed to fix this problem in VS 2012 by opening the Property Pages on my Website, opening the 'MSBuild Options' tab, and unchecking the 'Allow this precompiled site to be updatable' option, then hitting 'save all'.