Getting (partial) color on Razor pages

It definitely looks dull and drab without the color-coding. So, for those who cannot wait till the next bits come out, here’s one way.

Go to Tools->Options in your Visual Studio environment .In the Text Editor section, choose ‘File Extension’ section, add .cshtml (or .vbhtml) in the ‘Extension’ textbox and choose ‘HTML Editor’ or ‘HTML Editor with Encoding’.

image1

You might have to reopen the Razor files to see the coloring of HTML tags.

image2 

Just a note, this does not color the ‘@’ or any of the MVC-specific ‘stuff’.

No Comments