问题
While calling XslCompiledTransform.Transform()
method I get this exception :
The Writer is closed or in error state.
Anyone know what it means?
回答1:
It means that...The Writer is closed or in error state.
Show us the surrouding code. It looks like you have a StreamWriter associated with that object that has been disposed or threw an error. For example:
using( var stream = new SomeStream() )
using( var streamWriter = new StreamWriter() )
{
someObj.SomeStreamWriter = streamWriter;
// ...
}
// should throw an error as streamWriter
// has been disposed of by this point.
someObj.WriteToStream();
来源:https://stackoverflow.com/questions/9167653/the-writer-is-closed-or-in-error-state