Your custom Utf8StringWriter
class has no constructor accepting a parameter, but you're trying to pass a value to it. That's why you're getting the error message.
Add a public constructor that accepts a StringBuilder
, then pass it on to the base class:
public class Utf8StringWriter : StringWriter
{
public Utf8StringWriter(StringBuilder stringBuilder)
:base(stringBuilder)
{
}
public override Encoding Encoding { get { return Encoding.UTF8; } }
}