A COBCH0845 error means that the class is not found. Since StringWriter is a .NET class you should Google the MSDN documentation to see what namespace and assembly that it resides in.
Namespace: System.IO
Assembly:mscorlib (in mscorlib.dll)
Since StringWriter is in the System.IO namespace you need to add an ilusing"System.IO" directive in order to reference the name StringWriter without using System.IO.StringWriter.
mscorlib.dll should be referenced automatically.