21

Since I uploaded an updated version of an ASP.NET MVC 1 application to the server, the Yellow Screen of Death has changed to something like this:

��I�%&/m�{J�J��t��$ؐ@�����iG#)�*��eVe]f@�흼��{���{��;�N'���?\fdl��J�ɞ!���?~|?"��Ey�')=��y6����h���ͼhR��L�w�|��2=��Ez<����7�:5�<�+oy��:� �T����W�v�<[��~2�g�2��?�ʋ�y�hYՋ������t� _N���M�l�����{�,��Xn���Q�}�����*g�������7�� ~��j'u>K�{�IW4�>�U�w�|=-fYzR-���

When accessing pages with errors directly on the server via Remote Desktop (Windows Server 2008 R2, IE8), IE even tries to download the response but get's an error (message box).

Anybody encountered this before? Any idea how to solve this?

I also found this question, which seems to be very simliar, but unfortunately has not been answered by now: ASP.NET MVC app displaying weird characters

3
  • Can you use Fiddler or Firebug to see the response? Also, check the eventlog; .NET should be reporting the error there. Commented Oct 18, 2010 at 20:41
  • Fiddler shows the same response as the browser. The error is a simple Exception. I threw it intentionally in this case, but I got the same result with other exception types. Commented Oct 18, 2010 at 22:39
  • Do you have any culture or text-encoding types set that could be changing the encoding? Or non-text MIME types in the header? Set in your web server, web.config, or the controller (or any action/authorization filters)? What is the complete header of the HTTP response? Commented Feb 21, 2011 at 16:56

1 Answer 1

36

Most likely the screen you're showing is caused by GZip encoding in your code. You probably are applying a Response.Filter to the GZip/DeflateStream class and intending to encode your content, but then an error occurs and ASP.NET clears your Headers, but leaves the filter intact. The result is that your content is GZip encoded but the browser doesn't decode it because the Content-Encoding header isn't set.

To fix this add:

Response.Filter = null

into your Application_Error routine at the top to force any Repsonse filters to clear out.

Another thing that can screw you up is OutputCaching of GZipped content. If any OutputCaching is applied make sure you have the VaryByCustom option to allow for the different encoding types (none, Gzip, Deflate most likely).

+++ Rick ---

Sign up to request clarification or add additional context in comments.

2 Comments

Couldn't believe it when I found this answer, I thought it was game over when I saw that served up - I've never been so happy to see the YSOD.
Crap. Good answer, but I'm getting this exact problem and it's not GZip related.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.