My company has a web forms project that we converted to an MVC 3 project over a month ago. Everything works great except for this annoying error that the parser gives on web forms page directives. I’m not sure when this started. I only just started noticing it a week ago, but it could have been there since we transitioned the project.
We followed this tutorial when modifying our web forms project to support MVC 3. The project compiles just fine. Beyond this annoying underline (shown below) there is no problem. Web forms and MVC have played nice together so far. However, intellisense within .ASPX markup does not work while the parser is displaying this error.
The type initializer for ‘System.Web.Compilation.CompilationLock’ threw an exception.
Does anyone have any experience with this issue? I have scanned the web.config as well as unloaded the project and scanned the .csproj xml. I can’t see anything wrong but I also don’t really know what I’m looking for. Google doesn’t turn up anything useful for this error in my situation.
I’m still not sure what was causing this. But a complete re-install of .NET and Visual Studio fixed the issue.