MVC 6 标签助手智能感知? [英] MVC 6 Tag Helpers Intellisense?
问题描述
是否应该为 Razor/MVC 6 中的新 asp-
标签助手提供智能感知?我一直在学习 Shawn Wildermuth 的一门关于 Pluralsight 的课程,一切正常,但我认为当我开始输入 asp-
作为标签上的属性时,我应该获得智能感知.
Is there supposed to be Intellisense for the new asp-
tag helpers in Razor/MVC 6? I was following along on one of Shawn Wildermuth's courses on Pluralsight and everything functions properly, but I thought I should be getting intellisense when I start typing asp-
as an attribute on a tag.
如果它应该存在,您对可能导致它消失的原因有什么想法吗?
If it should be there do you have any ideas on what might cause it to disappear?
我正在使用 Visual Studio 2015 社区和 RC1-Final 版本的 Kestrel、Mvc 和 TagHelpers 的 .Net 依赖项.
I'm using Visual Studio 2015 Community, and RC1-Final versions of the .Net dependencies for Kestrel, Mvc, and TagHelpers.
推荐答案
确保将 "Microsoft.AspNet.Tooling.Razor": "1.0.0-rc1-final"
添加到您的项目中.json 依赖项.
Make sure you add "Microsoft.AspNet.Tooling.Razor": "1.0.0-rc1-final"
to your project.json dependencies.
您还需要将 @addTagHelper "*, Microsoft.AspNet.Mvc.TagHelpers"
添加到您的 _ViewImports.cshtml 以使标签助手在您的所有视图中可用.
You also need to add @addTagHelper "*, Microsoft.AspNet.Mvc.TagHelpers"
to your _ViewImports.cshtml to make the tag helpers available in al your views.
您可以在 aspnet 5 文档页面
这篇关于MVC 6 标签助手智能感知?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!