Tag helper intellisense in VS 2017 ver 15.3.x not working

4.6k views Asked by At

In past versions of Visual Studio 2017 if a developer wanted to have tag helper intellisense they needed to install Razor Language Services as indicated in this SO answer: ASP.NET Core Tag Helper Intellisense in Visual Studio 2017 In prior versions of VS 2017 I did this and it worked great.

Recently I upgraded to Visual Studio 2017 version 15.3.2 from version 15.2 I believe and now my tag helper intellisense is no longer working.

I read here https://developercommunity.visualstudio.com/content/problem/55761/tag-helpers-intellisense-still-doesnt-work.html that in 15.3 tag helper intellisense was going to work out of the box. But in my case it does not.

To try to get it working I tried disabling Razor Language Services (thinking maybe it's not needed now) but then Visual Studio wouldn't let me open any cshtml files and complained with the following dialog:

enter image description here

So I re-enabled Razor Language Services but I am still unable to get tag helper intellisense working in the latest version of Visual Studio 2017 which is currently version 15.3.2. Below is a simple tag helper with no tag helper coloring:

enter image description here

Any suggestions on how to get Tag Helper intellisense working in this version of Visual Studio?

2

There are 2 answers

1
Sara Liu - MSFT On BEST ANSWER

Refer to this, please re-run the Visual Studio Installer as administrator and click More - Repair to repair, I tried to install the Razor Language Services extension to made the Tag Helper intellisense works in VS 2017 15.2, then upgrade it to the latest version 15.3.3 and just like you found, this intellisense not works, but after I repair the VS 2017 15.3.3 and restart the computer as VS required, then I check the Tag Helper Intellisense works again in my existing or new projects in here.

1
Mirek On

Is it possible that you have mixed namespaces and assembly names? I did not know that @addTagHelper consumes an assembly name, not a namespace which was apparently my mistake, tag helpers intellisense works well right now.

So in your _ViewImports.cshtml, instead of this

@addTagHelper *, YourApp.Some.Namespace

Should be this

@addTagHelper *, YourAssemblyNameInApplicationProperties