Today I had to deal with a nasty issue that happened on my Visual Studio 2017 Enterprise Edition, right after installing the VS2017 15.8.1 update. In a nutshell, I had lost intellisense and syntax highlighting / coloring for all my .cshtml files. All other file types (CSS, JS, HTML, etc.) were working fine.
Luckily enough, I ran into this great post from the Visual Studio Community (god bless communities) which pointed me the right direction to fix my issue.
Here's what you need to do:
- Close all the open/active instances of Visual Studio 2017.
- Start the Visual Studio Installer tool.
- Locate the VisualStudio 2017 instance that's causing the problem (I had 2 on my system: the Community Edition, which worked fine, and the Enterprise Edition, that was affected by the problem).
- Click the Modify button. A list of the installed software & add-on packages will appear.
- Locate the package called ASP.NET and Web Development and uncheck it, then click the Modify button to have it uninstalled (!)
- Right after that, click again the Modify button.
- Locate again the ASP.NET and Web Development package and check it, then click the Modify button to install it from scratch.
Once done, launch Visual Studio 2017: if everything went well, your Razor pages will now have proper Intellisense and syntax coloring.
That's it! I sincerely hope that this workaround will help many ASP.NET developers who have experienced this nasty Visual Studio 2017 issue.
6 Comments on “Visual Studio 2017 - Lost Razor Intellisense and Syntax Highlight - How to Fix it How to repair your Visual Studio 2017 installation and get back Intellisense and Syntax Highlight on your Razor pages & .cshtml files without reinstalling”
It worked for me.
Glad it worked! If you liked the post, don’t forget to add a like on FB and/or follow us on twitter :)
I did as directed, still does not work. Please advise. Thx!
I am using MS Professional Version of Visual Studio. I am not able to see Modify/Repair option in Visual Studio Launcher. Please help.
You should see the “modify” and “launch” buttons there.
See this screenshot:
Still solves issue in latest enterprise in 2019