views:

1227

answers:

6

Hi,

Just installed Microsoft Visual Web Developer 2010 and trying to create an 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?

+9  A: 

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

XIII
Thanks. I have just gone through the article and noticed it.
max
+5  A: 

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.

Screenshot.

Darin Dimitrov
How do you go about this, by the way?
Stacey
@Stacey In Visual Studio you go: Tools->Options choose "Text Editor"->"File Extension" put cshtml in the extension text box and choose "HTML Editor" in the editor drop down.
JHurrah
A: 

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.

Barry
A: 

Thank you very much to all of you for providing information

kanna
+6  A: 

You can install a visual studio extension to get highlighting but not intellisense. Razor Syntax Highlighter

BuildStarted
Very cool! We used the parser to write something similar internally, but the full editor with IntelliSense takes a little more work :). The full syntax editor is coming soon!
anurse
Yeah, I wrote that a few days ago but realized Intellisense was much more work than I was willing to commit. Especially since you guys would probably come out with a real version before I could finish it. There are still a few bugs with regards to parsing but it works well enough :)
BuildStarted
This does not work for Visual Web Developer 2010
Josiah Ruddell
A: 

Is this now possible with the new Beta release?

DaveHogan
No, I updated the top answer to reflect this
Jeff Moser