Visual Studio 2017中的ASP.NET Core标记帮助器Intellisense [英] ASP.NET Core Tag Helper Intellisense in Visual Studio 2017

查看:131
本文介绍了Visual Studio 2017中的ASP.NET Core标记帮助器Intellisense的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法运行所有标签(例如asp-for asp-action等)的Intellisense.

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的工具菜单中.

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.

注意事项:似乎您还必须从 .csproj 文件中删除任何Microsoft.AspNetCore.Razor.Tools参考(我的版本为1.1.0-preview4-final),以便在之后启用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屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆