TagHelpers doesn't get invoked after moving them to a different project

↘锁芯ラ 提交于 2019-12-02 09:02:26

The addTagHelper directive expects two comma-separated parameters. The docs has this to say about how it works:

The first parameter after @addTagHelper specifies the Tag Helpers to load (we are using "*" for all Tag Helpers), and the second parameter "Microsoft.AspNetCore.Mvc.TagHelpers" specifies the assembly containing the Tag Helpers.

Note what I've highlighted in bold: It's not the namespace that is needed; it's the assembly. In your example, you need to change that second parameter to reflect the new hosting assembly:

@addTagHelper *, LC.Tools.Utility
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!