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

Visual Studio 2017 - Lost Razor Intellisense and Syntax Highlight - How to Fix it

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.

 

About Ryan

IT Project Manager, Web Interface Architect and Lead Developer for many high-traffic web sites & services hosted in Italy and Europe. Since 2010 it's also a lead designer for many App and games for Android, iOS and Windows Phone mobile devices for a number of italian companies. Microsoft MVP for Development Technologies since 2018.

View all posts by Ryan

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.