I have Visual Studio 2010 /SP1 / MVC 3 (With April Tools Update) installed on a machine with a fresh install of Windows 7 64-bit Professional.
I do not have resharper installed. I never installed an RC or Beta of anything on this new OS Install.
My install steps were as follows:
Help > About Microsoft Visual Studio shows:
Microsoft Visual Studio 2010 Version 10.0.40219.1 SP1Rel
Microsoft .NET Framework Version 4.0.30319 SP1Rel
System.Web.Mvc.dll file version shows: 3.0.20105.0
Once installed I did the following:
Within the project here is the behavior:
Does anyone know a definitive set of prerequisites to have Razor Intellisense working? Something I can diff between the other Win7 64-bit machines that have Razor Intellisense working and the 2 that have this issue? Registry entries? Are there any Visual Studio logs that can help debug this? After hours of frustration and reading every Razor Intellisense post and question I have run across without coming up with anything that works I am just hoping for some new thoughts on what to troubleshoot/try next.
Thanks for any help on this.
I know it's been a while since the last post, but I fixed mine by uninstalling MVC 2 and MVC2 VS Tools, and only leaving MVC 3 installed.
If you have MVC4 and MVC3 installed you need to add this to appsettings in web.config (in root and in Views folder) to use MVC3
<appsettings>
<add key="webpages:Version" value="1.0.0.0">
...
</appsettings>
Also check your references in root web.config, they should included these versions
<add assembly="System.Web.Helpers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Web.WebPages, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
Re-open your solution for settings to take effect
I just wasted 2 hours of my life on this. What happened to me is that the web.config file got checked in wrong and was no longer Unicode UTF8. When VS 2010 opened the solution, it checks the web.config file for the appsettings:
<add key="webpages:Version" value="2.0.0.0" />
<add key="webpages:Enabled" value="true" />
Since the file couldn't be read by normal means, it just skipped it entirely, causing VS to think you needed to reinstall MVC... I just wanted to post this in case someone else runs into the same problem for an easy fix.
Razor Intellisense work with Razor Editor
Check if it is selected as default editor, For this do
Again check files must be opened in Razor Editor. I have done this and its working now.
I fixed it by right clicking on the cshtml file and selecting "View Markup".
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With