Just installed Microsoft Visual Web Developer 2010 and trying to create 开发者_如何学Can MVC application with Razor View Engine.
When opened a ".cshtml" file, I am not able to get colors for syntaxes in editor and also intellisense is not appearing. Is there any option I explicitly need to enable it?
UPDATE: The Release Candidate finally supports Razor IntelliSense.
Update2: The final release got announced here and it also still supports Intellisense for Razor syntax. Woohoo!
Here's a screenshot of the new enhanced Intellisense and Razor syntax highlighting:
For a great overview/introduction to MVC3 and NuGet I suggest you take a look at this PDC10 video.
Previous Answer
No. It doesn't work yet with the current beta:
Razor intellisense isn't in today's beta. We needed to do a little more testing (and bug fixing) before we were ready to distribute it broadly. It patches a few VS files and so we need to make sure it is 100% solid before giving it out broadly.
It will definitely be in the final release, though, and should be available for people to install in the next few weeks.
Thanks,
Scott
Taken from http://weblogs.asp.net/scottgu/archive/2010/10/06/announcing-nupack-asp-net-mvc-3-beta-and-webmatrix-beta-2.aspx#7624491
You can install a visual studio extension to get highlighting but not intellisense. Razor Syntax Highlighter
You can get syntax highlighting by associating the .cshtml
extension with the HTML editor in the Visual Studio properties (this will highlight only HTML tags and not Razor syntax). IntelliSense doesn't work yet. Microsoft will release an extension to Visual Studio which will support it in a later version.
ASP.NET MVC team has just released RC release for ASP.NET MVC 3 and it has intellisense for Razor engine. :)
Follow this link for more information:
http://weblogs.asp.net/scottgu/archive/2010/11/09/announcing-the-asp-net-mvc-3-release-candidate.aspx
The intellisense and syntax highlighting does not work in the current version. It is due to be fixed for the final release though.
Saw a demo from Scott Gu on Friday - the Razor View engine looks very cool.
精彩评论