Tag helper not being processed in ASP.NET Core 2

后端 未结 1 808
北海茫月
北海茫月 2020-11-29 12:51

I\'ve added the following tag helper:

using System;
using System.Linq;
using Microsoft.AspNetCore.Mvc.ModelBinding;
using Microsoft.AspNetCore.Mvc.Rendering;         


        
相关标签:
1条回答
  • 2020-11-29 13:14

    When registering Tag Helpers, it’s the assembly that is required, not the namespace - explained in the docs.

    ...the second parameter "Microsoft.AspNetCore.Mvc.TagHelpers" specifies the assembly containing the Tag Helpers. Microsoft.AspNetCore.Mvc.TagHelpers is the assembly for the built-in ASP.NET Core Tag Helpers.

    So in your case, you can just change this:

    @addTagHelper *, X.TagHelpers
    

    To this:

    @addTagHelper *, X
    
    0 讨论(0)
提交回复
热议问题