Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ASP.NET Core Tag Helper Intellisense in Visual Studio 2017

I am unable to get Intellisense for all tags (e.g. asp-for asp-action, etc.) I'm running Visual Studio 2017.

My .csproj file includes the following packages:

<PackageReference Include="Microsoft.AspNetCore" Version="1.1.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="1.1.1" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.TagHelpers" Version="1.1.1" />
<PackageReference Include="Microsoft.AspNetCore.Razor.Tools" Version="1.1.0-preview4-final" Type=""/>
<PackageReference Include="Microsoft.AspNetCore.Razor" Version="1.1.0" />
<PackageReference Include="Microsoft.AspNetCore.Razor.Runtime" Version="1.1.0" />

and my _ViewImports.cshtml file includes the following:

@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers

Is there something I need to edit or add?

like image 422
Ryan Buening Avatar asked Feb 16 '17 16:02

Ryan Buening


1 Answers

For VS2017 RTM (if you've upgraded by now) you need to install Razor Language Services from Extensions and Updates... in Tools menu within Visual Studio.

Caveat: It seems as if you also have to remove any Microsoft.AspNetCore.Razor.Tools reference (I had version 1.1.0-preview4-final) from your .csproj file to enable IntelliSense after installing the extension above.

like image 90
joakimriedel Avatar answered Sep 20 '22 05:09

joakimriedel