The following worked for me with Visual Studio Professional 2012, ASP.NET MVC 5 and Microsoft.System.Web.WebPages 3.0:
<add key="webpages:Version" value="3.0.0.0" />
But this solution did not work immediately
At first, Chris Haddox's solution regarding webpages:Version
:
<add key="webpages:Version" value="1.0.0.0"/>
did not work for me, I already had this key and it was set to 1.0.0.0.
But since I am using Visual Studio Professional 2012, ASP.NET MVC 5 and Microsoft.System.Web.WebPages 3.0...
This issue showed me that my Web.Config webpages:Version
was set to 1.0.0.0
, I changed it to 3.0.0.0
because I read in another article that might be correct for Microsoft.System.Web.WebPages 3.0 and I still had the formatting bug for a little while.
I continued to make edits to my .cshtml file. Then, all of the sudden formatting started working correctly. Maybe from building, but I do not think that I did do a build, but can't be sure, and I know that I did not restart Visual Studio 2012.