I just spent several hours trying to figure why a new ASP.NET MVC 3 application was spewing garbage. I fixed the problem, but I still do not know the underlying of the junk. I found several unanswered threads concerning this issue.
I recently got a new development PC that has Windows 7 / IIS 7 installed on it. Our application is built on ASP.NET 3.5. Whenever our application throws an error now..instead of the standard ASP.NET error page with the detailed stacktrace, I receive garbage similar to:
�`I�%&/m�{J�J��t��`$ؐ@������iG#)�*��eVe]f@�흼��{���{���;�N'���?\fdl��J�ɞ!���?~|?"��Ey�')=��y6����h���ly���,-��E;Oϫ:��'Y�o��N��Y�����]i�h���tRͮ�_|^-���lQ�>�ɼ�e��C��*/.��eU/�R>j����|q8�ʪ~4)����_�zpW�����b��V�G���ջ_��z������w�_�� �7�݃U����,
The heart of the solution was the in this question. It turns out that I could force the site to exception out and return an appropriate error. I could also access valid physical files on the server. I assumed I had an issue with the routing module or a corrupt ASP.NET or MVC install, and went about trying to fix that.
After a while, I finally implemented logging to see what was happening. Unfortunately it was something extremely silly: it couldn’t access the database.
The error message, on the other hand, is a complete waste of time. I do not know what causes IIS to do this, but if you’re receiving it make sure your application logging is on, and then check for problems in there.