Will "the Mighty" Strohl

"Ouch! I think something up and bit me."

First, a funny quote because I have to share it with SOMEONE!

I can picture in my mind a world without war, a world without hate. And I can picture us attacking that world, because they'd never expect it.
    - Jack Handy

No matter how long you have been doing a particular job, there are things that will from time to time jump up and bite you in the rear.  It would be expected though, if these things were new problems that you had never before encountered or heard of.  However, it seems to me that this usually happens not from new problems, but from old problems from long ago that you failed to prevent this one time.  So here is a fresh reminder to an old problem.

Case and point…

I was rolling out some code today to update a website I am a part of, called RezHub.com, you may have heard of it.  Part of this upgrade was to migrate the website and the remaining child assemblies to .Net Framework version 3.5.  Well, upon rolling out the code, I quickly realized when I attempted to view the site that I had not yet upgraded the web.config to compile against the 3.5 framework.  That’s not a problem.  I quickly diff’d the web.config files from the staging website to the production website.

Time to view the website again…  “Uh oh!  The site is still not compiling!  What in the world is going on?!  Everything is there!”  Now enter the curse words.

The typical thing would be to either set the web.config to show the error remotely, or to view the site locally (on the same server) if you can.  Well, I first set the error to display externally.  I changed the customErrors setting to “Off.”  When I refreshed the page, the website didn’t appear to compile like it normally does with a web.config change.  “Hmmm…”

I double-checked the web.config setting and it was still set to show the compilation error to the world.  As a last ditch effort, the dim lightbulb in my head lit up and told me to view the site locally.  Duh!  I don’t know why I did that to begin with.

Needless to say, but the error showed locally when it wouldn’t show externally, even though the web.config was set to allow it to.  If you are confused right now, think about this…  The default setting for web applications is to not show the compilation errors externally.  So, if the error is not showing externally when you specified it to do so, then there is a problem with your web.config.  Either it doesn’t exist in the correct location, or there was a parsing error when reading the XML in the web.config document.

My problem ended up being the latter.  When adding the XML for the .Net 3.5 migration, I accidentally added an extra closing element for one of the sections.  This resulted in an invalid XML document, and the web server not being able to parse it.  Viewing the site locally told me that.

Stupid Will!  :)

blog comments powered by Disqus