I followed a few guides on creating a custom tag helper for ASP Core.
This is my helper:
using Microsoft.AspNetCore.Mvc.ViewFeatures;
using Microsoft.Asp
I had the same problem, but it was the result of a rogue, accidental semi-colon at the end of the @addTagHelper
line.
I had:
@addTagHelper *, ToolConstrolSystem;
Instead of:
@addTagHelper *, ToolConstrolSystem
While the solution will build and run fine, the tag helper will not work if the @addTagHelper
line contains a semi-colon.
Another thing to check if you're finding you can't set your content with calls like:
output.Content.AppendHtml("<tags...>");
output.Content.SetHtmlContent("<tags...>");
Is to check that you didn't use your tag helper as an empty/void element, e.g.:
<my-tag-helper attr="value" />
To add content the tag helper must have a closing tag:
<my-tag-helper attr="value"></my-tag-helper>