views:

44

answers:

2

In my ASP.NET (3.5) application, I don't have global exception handling, and if an unhandled exception is thrown, instead of getting the standard yellow ASP.NET error, I'm getting a bunch of junk characters (fairly long, and different each time) - stuff like:

y6����h����H'��:���ղ�>�Ey�裟��Y��>:�O���b�>ZV�"+壦�A�(?��Ӫ��G�2��=�%�w�@}

Obviously, I'll fix this by putting the correct exception handling in the app, but do you have any idea what this could be? For debugging purposes, it's sometimes nice to see the yellow exception screen.

I see this both in my dev environment (Windows 7) and on the server (I think it's Windows Server 2003 with IIS6, but I'm not sure).

It happens on all browsers - if I view source, the junk characters are actually in the source.

Thanks

+1  A: 

That sounds like some sort of memory corruption. Have you tried debugging by stepping through the code execution via Visual Studio on your dev machine? Debugging through YSODs alone can sometimes make it hard to find the exact cause of the error.

Josh
Debugging just gets me to the point when the exception is thrown, then when I continue, I get the nonsense chars instead of the yellow screen. I know it's not a physical memory since it's identical behavior on my local machine and the server which is hosted elsewhere.Thanks
Joe Enos
Can you share the function call in the code that throws the error? I've seen strange situations like this in the past when there are underlying permissions errors, which could be something that would impact your test and production platforms.
Josh
Josh - thanks, but check out the other answer that's marked as accepted - it turned out it was related to the compression I had turned on.
Joe Enos
+1  A: 

This could be a character encoding issue.

Keltex
Wasn't related to .NET character encoding, but rather the content-encoding of my response. I'm using the Application_PreRequestHandlerExecute in Global to compress the output using deflate or gzip, and somehow this code is screwing things up. Found it by searching the code for the word encoding. Removing it returned the yellow error screen.Now that I know the cause, I feel better about doing the global error handling.Thanks for the idea.
Joe Enos