Error in my second website


I'm on my dev system and I have the test website with SQL Server mode running. I created a second with my existing website information thinking I should be able to integrate this into our ASP website, but I'm getting an error.

I've added the test pages to my site and I'm seeing that the ASP.NET variable is viewable from the ASP page, but not vice versa. I ran testmanaged.asp and I get the following error. I'm hoping you know something simple that I'm missing in my integration.
The value from ASP.NET is: 
System.Web error '80004005' 

Unable to serialize the session state. In 'StateServer' and 'SQLServer' mode, ASP.NET will serialize the session state objects, and as a result non-serializable objects or MarshalByRef objects are not permitted. The same restriction applies if similar serialization is done by the custom session state store in 'Custom' mode. 

/WAVE/testmanaged.asp, line 23 
Closed Jul 6, 2015 at 5:38 AM by dotneteer
As suggested by AnbdreaWil2


dotneteer wrote May 16, 2015 at 6:31 AM

I am currently on vacation so I will look into this further when I return. In general, NSession will not be able to serialize an object if it does not know the type of serializable object in the assembly. A portion of the code runs outside my code so I have to find a solution so that it does not error our when it encounters an unknown type. However, even we avoid the error, asp classic mostly likely will not be able to access the .net object.

AndreaWil2 wrote May 18, 2015 at 4:07 AM

Thanks for responding , even though you are on vacation!

I'm still relatively new to this website, so I looked for an object in the session variables and sure enough, there are several. One is a navigation stack, custom built COM object and then others are for Crystal Reports.

I doubt very much I can get sign off to replace these things as they work pretty well and are optimized for Classic ASP. I'm hoping we can figure out something, because I think this issue pretty much blocks us from moving forward with the side by side agenda for this website, unless we can figure out another way to deal with this.

If there is an error because of this, is there a way to skip that particular session variable and continue adding the rest of them? basically skipping the saving of that particular value to .NET and keeping in the Classic ASP session only? Basically don't transfer that one, but transfer the variables that it knows? I know that would not be ideal, but it would be a work around that might help us get further and closer to replacing this old classic asp code.

I'll talk to a few people here in the office this week and see if anyone else has any other ideas to get around the issue.


AndreaWil2 wrote May 18, 2015 at 9:52 PM

I was able to pull out the objects from the session and now I thin I'm having a caching issue. I login, and I get to the next page, but if I iterate through the session variables, they are not updated from my login. So it appears that the instantiation creates the variables the first time, but when I change one, it's still pulling the first value entered.

However, if I delete the record manually in the SQL database, the ASP.NET session variables are wiped out, but if I iterate through the Classic ASP variables they are there, not only that, but it recreates the record in the dB.

AndreaWil2 wrote May 19, 2015 at 9:44 PM

Update on the last issue....

It wasn't a caching problem. After doing numerous tests, I concluded that if you put the instantiation of the object in the top of a file where the following code is used, it doesn't bring the session variables back into the page as expected.


When I moved this inside <% %> tags then it works as expected. You might want to document that.

I took out our custom dll from the session and replaced it with another means of doing the same thing and now the object is working as expected, no errors.

Now I'm going to create a page in ASP.NET to do something and demonstrate that it works seamlessly to upper management. I'm pretty excited again!


AndreaWil2 wrote Jun 11, 2015 at 6:22 PM

Hi, This can be marked as Completed/Closed. Thanks!