I am trying to add a special tag helper, but when I try to add an assembly as a link in _ViewImports.cshtml, it does not recognize it.
I do this (_ViewImports.cshtml):
@using ProjectName.Web.Main
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
@addTagHelper *, TagHelpers
and also I tried:
@addTagHelper *, ProjectName.Web.Main.TagHelpers
my tag helper looks like this:
using Microsoft.AspNetCore.Razor.TagHelpers;
namespace ProjectName.Web.Main.TagHelpers
{
[HtmlTargetElement(Attributes="class")]
public class CssClassTagHelper : TagHelper
{
public override void Process(TagHelperContext context, TagHelperOutput output)
{
output.Attributes.Add(new TagHelperAttribute("class","testing"));
}
}
}
but when I run the application, I get the following exception:
Cannot resolve TagHelper containing assembly "TagHelpers". Error: Failed to load the file or assembly 'TagHelpers, Culture = neutral, PublicKeyToken = null' or one of its dependencies. The system cannot find the specified file. @AddTagHelper *, TagHelpers
I already have googled, but I get mixed answers between different versions of dotnetcore until I find no solution.
I am using RC2.
any ideas, suggestions?