The Writer is closed or in error state

大憨熊 提交于 2021-01-27 21:16:49

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!