“Connection to the server has been reset…” problems with ASP.Net after installing SQL Express 2008

The fix: I put these two attributes in the <pages> element in your web.config file…

enableEventValidation=”false” viewStateEncryptionMode=”Never”

Found the solution here after much installing/reinstalling/updating/frustration/hassle/crying/thoughts-of-giving-up-on-web-development-and-becoming-a-security-guard-again:

http://siderite.blogspot.com/2007/08/aspnet-connection-to-server-has-been.html

Now here’s the interesting thing…I removed the two attributes and saved web.config to confirm the fix.  My site still worked.  So I did an iisreset to make doubly sure, and voila – the site broke again without those attributes.  So, as is often the case when you’re trying to convince a laptop with Vista Home Premium that it’s actually a web server, beware false positives, false negatives and any other results you might get.  Clear your browser cache and do an iisreset whenever you fiddle with this kind of stuff.

So why did this work?  I managed to track down the spot where it was breaking, and it was inside a component that’s part of the third-party e-commerce suite we’re using.  It was obviously trying to do some data access that SQL 2008’s components didn’t like.  Why would the ASP.Net forms stuff affect it?  Black Box hoodoo voodoo reasons, I guess.  Was it the attributes that actually fixed the problem, or did my web.config just need to be fiddled with so the site would recompile in a certain way?  Sadly, I am too busy to dig into that mystery.

edit: removed a space from the attributes.

Advertisements

One response to this post.

  1. Thanks for linking to my blog and I am glad I could help. Keep up the good work!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: