after adding @addTagHelper to the *.cshtml file. e

2019-09-13 03:15发布

问题:

When I Use

@addTagHelper "*, Microsoft.AspNet.Mvc.TagHelpers"

in My .cshtml file it causes error 500. but it's work in another ViewComponent

回答1:

which version? please give us more information. if you are using rc1-update1 use @addTagHelper *, Microsoft.AspNet.Mvc.TagHelpers



回答2:

I had the same problem and couldn't figure out the exact cause. However, changing the "Microsoft.AspNet.Mvc.TagHelpers" depencency in my json file from "6.0.0-betaX" to "6.0.0-rc1-final" fixed the issue. Make sure to restore packages after this change.

Also: as suggested the @TagHelper statement should go to your _viewImports.cshtml file.