Visual Studio 2017 中的 ASP.NET Core 标记帮助程序 Intellisense [英] ASP.NET Core Tag Helper Intellisense in Visual Studio 2017
问题描述
我无法获得所有标签的 Intellisense(例如 asp-for
asp-action
等)我正在运行 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.
我的 .csproj
文件包含以下包:
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" />
我的 _ViewImports.cshtml
文件包括以下内容:
and my _ViewImports.cshtml
file includes the following:
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
有什么我需要编辑或添加的吗?
Is there something I need to edit or add?
推荐答案
对于 VS2017 RTM(如果您现在已经升级),您需要安装 Razor 语言服务来自 Visual Studio 中 Tools 菜单中的 Extensions and Updates....
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.
警告:似乎您还必须删除任何 Microsoft.AspNetCore.Razor.Tools
参考(我有版本 1.1.0-preview4-final
) 从您的 .csproj 文件中,以在安装上述扩展程序后启用 IntelliSense.
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.
这篇关于Visual Studio 2017 中的 ASP.NET Core 标记帮助程序 Intellisense的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!