It seems to me that there are major breaking changes in TagBuilder as of beta7 with no mention about them in the announcements repo.
Specifically .ToString no longer ren
Building on @Mihai's answer to show the actual code for the StringWriter approach:
// Create tag builder
var builder = new TagBuilder("img");
//...
// Render tag approach also changed in .NetCore
builder.TagRenderMode = TagRenderMode.SelfClosing;
//Create the StringWriter and make TagBuilder "WriteTo" it
var stringWriter = new System.IO.StringWriter();
builder.WriteTo(stringWriter, HtmlEncoder.Default);
var tagBuilderIsFinallyAStringNow = stringWriter.ToString();