I am currently working on a MVC3 project with Razor. I have switchen on compilation of Views to be aware of spelling errors etc. at compile-time.
As soon as I switch
This problem occurs when there is web project output (templated web.config or temporary publish files) in the obj folder. The ASP.NET compiler used isn't smart enough to ignore stuff in the obj folder, so it throws errors instead.
Another fix is to nuke the publish output right before calling
to this:
That will delete all web.configs under \obj, as well as all PackageTmp folders under \obj.