I found a thread: Highlighting kills my Razor syntax in Visual Studio 2010 , asking and explaining how to turn off the highlighting for Razors code.
The problem is,
You have to find Tools -> Options ->Environment -> Fonts and Colors -> HTML Razor Code Background
to change it in VS 2013.
As an addition to Mateusz Rogulski & goku_da_master's answers, if you select Automatic for the Item background instead of Black (for dark theme), the setting will continue to work if you change the VS theme.
Although the instructions on the accepted answer takes you to the correct settings that needs to be adjusted, it took a while for me to adjust the settings. So for those like me, the key is to change the Item Background
property of the HTML Razor Code Background
, but the background color you need to choose should be the same as that of Plain Text
(the first item in Display Items list). Since I use dark theme, that default color of Plain Text
wasn’t available for HTML Razor Code Background
. So I had to go Custom…
copy the color settings from Plain Text
, and then got HTML Razor Code Background
, Custom…
and plugin those color setting number and now that highlight is gone!
Combining Mateusz Rogulski & goku_da_master's answers, this worked for me:
Tools -> Options ->Environment -> Fonts and Colors -> HTML Razor Code Background
Item background
to Black
, if it isn't alreadyItem foreground
to White
Please see option that starts with HTML (i know its not obvious but does the trick).