title: Net Core: Use a Tag Helper in a Custom Tag Helper that returns Html?
body: <p>I am trying to conduct this question except in .Net Core 2.</p>
  
  <p><a href="https://stackoverflow.com/questions/42010429/can-i-use-a-tag-helper-in-a-custom-tag-helper-that-returns-html">Can I use a Tag Helper in a custom Tag Helper that returns html?</a></p>
  
  <p>"
  I would like to use a tag helper within a tag helper. I looked around and couldn't find anyone else trying to do this, am I using a poor convention or am I missing documentation?</p>
  
  <p>Ex. Tag Helper A outputs HTML that contains another tag helper."</p>
  
  <p>How would I resolve the compilation error below?</p>
  
  <pre><code>[HtmlTargetElement("tag-name")]
  public class RazorTagHelper : TagHelper
  {
      public override void Process(TagHelperContext context, TagHelperOutput output)
      {
          StringBuilder sb = new StringBuilder();
          sb.Append("&lt;a asp-action=\"Home\" ");
          output.Content.SetHtmlContent(sb.ToString());
      }
  }
  </code></pre>
  
  <p>Is there a way for me to process the   tag helper from C#? Or to reprocess the output HTML with tag helpers?
  "</p>
  
  <p><strong>Tried this marked Solution from Taylor Mullen:</strong></p>
  
  <pre><code>var anchorTagHelper = new AnchorTagHelper
  {
      Action = "Home",
  };
  
  var anchorOutput = new TagHelperOutput("a", new TagHelperAttributeList(), (useCachedResult, encoder) =&gt; new HtmlString());
  var anchorContext = new TagHelperContext(
      new TagHelperAttributeList(new[] { new TagHelperAttribute("asp-action", new HtmlString("Home")) }),
      new Dictionary&lt;object, object&gt;(),
      Guid.NewGuid());
  await anchorTagHelper.ProcessAsync(anchorContext, anchorOutput);
  output.Content.SetHtmlContent(anchorOutput);
  </code></pre>
  
  <p><strong>Receiving Error Below</strong></p>
  
  <pre><code>There is no argument given that corresponds to the required formal parameter 'value' of 'HtmlString.HtmlString(string)'
  </code></pre>