Menu

How To Fix MVC 6 Tag Helpers Intellisense in Visual Studio

Updated: February 18, 2017

Ali Taheri

Recently I have started a project in ASP.NET Core 1.0 to learn about the new shiny features in .NET Core. 

As my first .NET Core project, I was not quite familiar with Tag Helpers and I was expecting the intellisense in Visual Studio to come to my help, but unfortunately that wasn't the case and I had to Google around to fix the intellisense for Tag Helpers. 

Here is the steps I have followed to make the Visual Studio intellisense work for MVC 6 Tag Helpers:

1. In the project.json file in the root level of my project I have added the below line to to the list of dependencise. 

"Microsoft.AspNet.Tooling.Razor": "1.0.0-rc1-final",

2. Then added the below line  to _ViewImports.cshtml file in the root level of Views folder in my project. If this file doesn’t exist, create it in the Views folder.

 @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers

If you still don’t get the intellisense and Using ReSharper 10 you must follow the steps below: 

Apparently ReSharper 10 doesn’t support .NET Core, so you have to do extra steps to enable intellisense in CSHTML files.

  1. Go to ReSharper menu and select Options
  2. Expand Environment and then IntelliSense
  3. Click on General and then on the right hand side instead of ReSharper select Custom Intellisense
  4. Then make sure in HTML option you have selected Visual Studio instead of ReSharper. (refer to screenshot below)

 

Re Sharper - Turn Off Intellisense

 

I hope you find this article useful ! 

 

Tags

ASP.NET Core Tag Helpers
comments powered by Disqus

© 2017 - Ali Sheikh Taheri