Areas' View Tag Helper Intellisense no use in

2019-09-08 11:24发布

I am using asp.net core 's Areas feature in my project I use the newest vs2017. It's fine to use the tag helper Intellisense in the normal default 'Views' folder,But no Intellisense in the areas' view How to solve this issue?

标签: razor
2条回答
狗以群分
2楼-- · 2019-09-08 11:50

just add this code at the top of the cshtml file:

@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers

or copy the _ViewImports.cshtml file to the area's view folder

查看更多
3楼-- · 2019-09-08 11:55

It now even works when adding it to _ViewImports.cshtml, so for example:

@using AmpTagHelpers @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers @addTagHelper AmpTagHelpers.*, AmpPwaApps @addTagHelper MaterialTagHelpers.*, AmpPwaApps

查看更多
登录 后发表回答