Server cannot set content type after sending HTTP headers - tracking this

One of our users receives an error message in our web application. We could not duplicate this problem, and I suspected that it was connected to the network. I tried the application using my laptop in my office and my home, and confirmed that the problem only occurs in their office.

I went to the server and looked at the event viewer right after they tried in my office, and the next warning was in the log.

I don’t understand how to start tracking this. Any suggestions?

The event log. The log below:

Event ID: 3005 Event Message: An unhandled exception occurred. Event Time: 06/20/2012 18:32:45 PM Event Time (UTC): 06/20/2012 10:32:45 PM Event ID: ebf8f628a9b3457cbea117c8c2da2186 Event Sequence: 2970 Event: 26 Event ID: 0 Application Information:

Application domain: /LM/W3SVC/50/ROOT-1-129847041933281152 
Trust level: Full 
Application Virtual Path: / 
Application Path: c:\websites\foobar.acme.com\ 
Machine name: MyServer    Process information: 
Process ID: 15152 
Process name: w3wp.exe 
Account name: NT AUTHORITY\NETWORK SERVICE    Exception information: 
Exception type: HttpException 
Exception message: Server cannot set content type after HTTP headers have been sent.    Request information: 
Request URL: http://foobar.acme.com/Project/Evaluate/ResultsXML.aspx?step=89&uid=4397&rnd=hhf8oe

Request path: /Project/Evaluate/ResultsXML.aspx 
User host address: 192.168.102.1 
User:  
Is authenticated: False 
Authentication Type:  
Thread account name: NT AUTHORITY\NETWORK SERVICE    Thread information: 
Thread ID: 12 
Thread account name: NT AUTHORITY\NETWORK SERVICE 
Is impersonating: False 
Stack trace:    at System.Web.HttpResponse.set_ContentType(String value)    at System.Web.UI.Page.SetIntrinsics(HttpContext context,
Boolean allowAsync)    at
System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context)   
at System.Web.UI.Page.ProcessRequest(HttpContext context)    at
ASP.error_aspx.ProcessRequest(HttpContext context)    at
System.Web.HttpServerUtility.ExecuteInternal(IHttpHandler handler,
TextWriter writer, Boolean preserveForm, Boolean setPreviousPage,
VirtualPath path, VirtualPath filePath, String physPath, Exception
error, String queryStringOverride)
Custom event details:
+5
source share
2 answers

Perhaps this is due to the integrated and classic mode of the pipeline. Compare your two environments and make sure they are no different in this regard.

IIRC in integrated pipeline mode, you can reset or delete headers after they have been written; in classic mode you cannot.

If you don’t know the difference, check out this article.

0
source

, , . , , /.

  • , - , , .

  • , (, ? 500 ? ? ?)

  • , (, IIS). , , . , accept, - , , .

:

ResultsXml.aspx - - ; (, PDF XML); -inline; . , .

, , :)

0

All Articles