我有一个WCF服务,它基本上是在循环中运行的,并将文件输出到一个目录。
我得到了这个有趣的错误,我设法找到与跟踪启用
<E2ETraceEvent xmlns="http://schemas.microsoft.com/2004/06/E2ETraceEvent">
<System xmlns="http://schemas.microsoft.com/2004/06/windows/eventlog/system">
<EventID>524340</EventID>
<Type>3</Type>
<SubType Name="Error">0</SubType>
<Level>2</Level>
<TimeCreated SystemTime="2010-03-06T14:06:35.3593750Z" />
<Source Name="System.ServiceModel" />
<Correlation ActivityID="{f133e2e7-d86a-4ce3-8e4a-427e502817d0}" />
<Execution ProcessName="w3wp" ProcessID="2036" ThreadID="5" />
<Channel />
<Computer>SLOW</Computer>
</System>
<ApplicationData>
<TraceData>
<DataItem>
<TraceRecord xmlns="http://schemas.microsoft.com/2004/10/E2ETraceEvent/TraceRecord" Severity="Error">
<TraceIdentifier>http://msdn.microsoft.com/en-US/library/System.ServiceModel.ServiceOperationExceptionOnReply.aspx</TraceIdentifier>
<Description>Replying to an operation threw a exception.</Description>
<AppDomain>/LM/W3SVC/1/Root/ISDS-1-129123577914375000</AppDomain>
<Source>System.ServiceModel.Dispatcher.ImmutableDispatchRuntime/38732823</Source>
<Exception>
<ExceptionType>System.Web.HttpException, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</ExceptionType>
<Message>Server cannot set status after HTTP headers have been sent.</Message>
<StackTrace>
at System.Web.HttpResponse.set_StatusCode(Int32 value)
at System.ServiceModel.Activation.HostedHttpRequestAsyncResult.SetStatusCode(Int32 statusCode)
at System.ServiceModel.Channels.HttpOutput.HostedRequestHttpOutput.PrepareHttpSend(Message message)
at System.ServiceModel.Channels.HttpOutput.Send(TimeSpan timeout)
at System.ServiceModel.Channels.HttpRequestContext.OnReply(Message message, TimeSpan timeout)
at System.ServiceModel.Activation.HostedHttpContext.OnReply(Message message, TimeSpan timeout)
at System.ServiceModel.Channels.RequestContextBase.Reply(Message message, TimeSpan timeout)
at System.ServiceModel.Channels.RequestContextBase.Reply(Message message)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.Reply(MessageRpc& rpc)
</StackTrace>
<ExceptionString>System.Web.HttpException: Server cannot set status after HTTP headers have been sent.
at System.Web.HttpResponse.set_StatusCode(Int32 value)
at System.ServiceModel.Activation.HostedHttpRequestAsyncResult.SetStatusCode(Int32 statusCode)
at System.ServiceModel.Channels.HttpOutput.HostedRequestHttpOutput.PrepareHttpSend(Message message)
at System.ServiceModel.Channels.HttpOutput.Send(TimeSpan timeout)
at System.ServiceModel.Channels.HttpRequestContext.OnReply(Message message, TimeSpan timeout)
at System.ServiceModel.Activation.HostedHttpContext.OnReply(Message message, TimeSpan timeout)
at System.ServiceModel.Channels.RequestContextBase.Reply(Message message, TimeSpan timeout)
at System.ServiceModel.Channels.RequestContextBase.Reply(Message message)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.Reply(MessageRpc& rpc)</ExceptionString>
</Exception>
</TraceRecord>
</DataItem>
</TraceData>
</ApplicationData>
</E2ETraceEvent>
我不知道是什么导致了这个问题,有没有想法从哪里开始尝试解决这个问题?