views:

67

answers:

2

I have an aspnet webapp which has worked very well up until now.

I was recently asked to explore ways of making it scale better.

I found that seperation of database and Webapp would help.

Further I was told that if I changed my session providing mechanism to SQLServer, I would be able to duplicate the Web Stack to several machines which could each call back to the state server allowing the load to be distirbuted better.

This sounds logical. So I created an ASPState database using ASPNet_RegSQL.exe as detailed in many locations across the web and changed the web.config on my app from:

<sessionState mode="InProc" cookieless="false" timeout="20" />

To:

<sessionState mode="SQLServer" 
 sqlConnectionString="Server=SomeSQLServer;user=SomeUser;password=SomePassword"
 cookieless="false" timeout="20" />

Then I addressed my app, which presented me with its logon screen and I duly logged in.

Once in I was presented, not with the page I was expecting, but with:

I can change the sessionstate back and forth. This problem goes away and then comes back based on which set of configuration I use.

Why is this happening?

+2  A: 

Nice error Dude :)

Probably a red-herring, but what are you storing in Session state?

When you move from InProc to SQL Server, the stuff you store in SQL must be Serializable (I think)

Steve Brown
I like that. Yeah I'll have to check the serializability of the data I'm storing
Rory Becker
We have a winner... Serveral classes have now been attributed as <Serializable> and all is ok... :D
Rory Becker
Now to figure out why we appear to be adding an entire hierarchy of controls to session.... Hmmmmm
Rory Becker
+1  A: 

Use Fiddler to see what's really going on over the wire. To me it looks like your app is sending back an image when the browser is expecting HTML.

Duncan Smart