Click here to Skip to main content
12,073,325 members (75,949 online)

The Weird and The Wonderful

   

The Weird and The Wonderful forum is a place to post Coding Horrors, Worst Practices, and the occasional flash of brilliance.

We all come across code that simply boggles the mind. Lazy kludges, embarrassing mistakes, horrid workarounds and developers just not quite getting it. And then somedays we come across - or write - the truly sublime.

Post your Best, your worst, and your most interesting. But please - no programming questions . This forum is purely for amusement and discussions on code snippets. All actual programming questions will be removed.

 
GeneralRe: Something original Pin
Jacek Gajek14-Aug-13 0:21
memberJacek Gajek14-Aug-13 0:21 
GeneralRe: Something original Pin
Sentenryu14-Aug-13 4:22
memberSentenryu14-Aug-13 4:22 
GeneralRe: Something original Pin
Jacek Gajek14-Aug-13 5:21
memberJacek Gajek14-Aug-13 5:21 
GeneralRe: Something original Pin
BCantor13-Aug-13 6:05
memberBCantor13-Aug-13 6:05 
GeneralRe: Something original Pin
Jacek Gajek13-Aug-13 6:51
memberJacek Gajek13-Aug-13 6:51 
GeneralRe: Something original Pin
Brisingr Aerowing19-Aug-13 17:20
professionalBrisingr Aerowing19-Aug-13 17:20 
GeneralRe: Something original Pin
ExcellentOrg21-Aug-13 1:04
groupExcellentOrg21-Aug-13 1:04 
RantFsking ASP.NET! Pin
Richard Deeming6-Aug-13 11:00
professionalRichard Deeming6-Aug-13 11:00 
OK, this is almost certainly my own damn fault, but I prefer to blame Microsoft. Smile | :)


I'm playing around with some of the new features of ASP.NET 4.5 on my local Win7/x64 box. One of the features I wanted to try was the build-in support for using the AntiXssEncoder[^] for any calls to HttpUtility.HtmlEncode[^]; this will replace my existing HttpEncoder class.

I updated the httpRuntime element in my web.config:
<httpRuntime encoderType="System.Web.Security.AntiXss.AntiXssEncoder, System.Web" />
and launched the test site.

Imagine my surprise when, instead of a nice web-page, I got a modal error dialog telling me that w3wp.exe has crashed in kernelbase.dll! Trying to debug the error with Visual Studio produces, after ten minutes of downloading symbols, a great big pile of assembly code.

Eventually, after digging through the event log, I found the problem: the encoderType attribute needs to be set to System.Web.Security.AntiXss.AntiXssEncoder, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - obvious, really!

The event log entries:
  • ASP.NET 4.0.30319.0 - Warning
    Exception type: ConfigurationErrorsException
    Exception message: Could not load file or assembly 'System.Web' or one of its dependencies. The system cannot find the file specified.

  • ASP.NET 4.0.30319.0 - Error
    An unhandled exception occurred and the process was terminated.

  • Application Error - Error
    Faulting application name: w3wp.exe, version: 7.5.7601.17514, time stamp: 0x4ce7afa2
    Faulting module name: KERNELBASE.dll, version: 6.1.7601.18015, time stamp: 0x50b8479b
    Exception code: 0xe0434352
    Fault offset: 0x0000000000009e5d

It seems that this error occurs at a point in the pipeline where ASP.NET can't recover, so it crashes the process instead. Which is good, in that it prevents the application from running in an unknown state. But it's also a pain in the arse to try to debug!



"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer


GeneralRe: Fsking ASP.NET! Pin
Bernhard Hiller6-Aug-13 21:57
professionalBernhard Hiller6-Aug-13 21:57 
GeneralRe: Fsking ASP.NET! Pin
Sentenryu7-Aug-13 10:08
memberSentenryu7-Aug-13 10:08 
GeneralWhen things to more than you think Pin
imagiro6-Aug-13 8:17
memberimagiro6-Aug-13 8:17 
GeneralRe: When things to more than you think Pin
Super Lloyd6-Aug-13 22:13
memberSuper Lloyd6-Aug-13 22:13 
GeneralUndoubtedly this is my own ignorance in glorious action but... Pin
Andy Bantly5-Aug-13 8:52
memberAndy Bantly5-Aug-13 8:52 
GeneralRe: Undoubtedly this is my own ignorance in glorious action but... Pin
Matt U.5-Aug-13 9:10
memberMatt U.5-Aug-13 9:10 
GeneralRe: Undoubtedly this is my own ignorance in glorious action but... Pin
Andy Bantly5-Aug-13 10:22
memberAndy Bantly5-Aug-13 10:22 
GeneralRe: Undoubtedly this is my own ignorance in glorious action but... Pin
Matt U.5-Aug-13 11:02
memberMatt U.5-Aug-13 11:02 
GeneralRe: Undoubtedly this is my own ignorance in glorious action but... Pin
Andy Bantly6-Aug-13 11:54
memberAndy Bantly6-Aug-13 11:54 
GeneralSo you think you know what double.Parse does? Pin
harold aptroot3-Aug-13 0:27
memberharold aptroot3-Aug-13 0:27 
GeneralRe: So you think you know what double.Parse does? Pin
PIEBALDconsult3-Aug-13 6:31
professionalPIEBALDconsult3-Aug-13 6:31 
GeneralRe: So you think you know what double.Parse does? Pin
Grimlock4-Aug-13 9:25
professionalGrimlock4-Aug-13 9:25 
GeneralRe: So you think you know what double.Parse does? Pin
harold aptroot4-Aug-13 10:07
memberharold aptroot4-Aug-13 10:07 
GeneralRe: So you think you know what double.Parse does? Pin
Grimlock7-Aug-13 8:38
professionalGrimlock7-Aug-13 8:38 
GeneralRe: So you think you know what double.Parse does? Pin
harold aptroot7-Aug-13 8:51
memberharold aptroot7-Aug-13 8:51 
GeneralRe: So you think you know what double.Parse does? Pin
Rob Grainger15-Aug-13 1:18
memberRob Grainger15-Aug-13 1:18 
GeneralRe: So you think you know what double.Parse does? Pin
Amitosh S.M.4-Aug-13 21:50
memberAmitosh S.M.4-Aug-13 21:50 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Mobile
Web03 | 2.8.160208.1 | Last Updated 11 Feb 2016
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid