2

I have a ASP.NET 3.5 website running on Windows Server 2003 and I'm using the ASP.NET State Service to manage sessions. It will appear to be working then I regularly get an error saying my code needs to have version 2.0 of the State Service running to work (I think that's what it said, I've temporarily switched back to storing sessions InProc). Refresh the page and the error goes away (for a bit, it's bound to come back).

So I looked at the properties of the ASP.NET State Service in the Services interface and it's mapping to a .exe in the 1.1 framework folder:

C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\aspnet_state.exe

There's a corresponding version in the 2.0 framework folder, but I don't know how to add it as a new service. I'm also not sure that adding the 2.0 version (and stopping and/or removing the 1.1 version) will solve the problem.

Thanks in advance for any help anyone can provide.

Mick

Mick Byrne
  • 14,394
  • 16
  • 76
  • 91
  • Well, I've done a bit of digging and came across the 'sc' command, in particular, the following command should do exactly what I need: sc config aspnet_state binPath="C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_state.exe Which is supposed to change the path the executable in the existing 'ASP.NET State Service'. However this just doesn't work at all and just brings up the usage instructions for this branch of the 'sc' command. Any more answers from out there would be greatly appreciated. – Mick Byrne Sep 06 '09 at 10:10
  • Also tried restarting the server (well the VPS container), just in case the .NET 3.5 framework installation hadn't quite finished yet. Didn't help. I think I'll just have to install the other one as a whole new service. – Mick Byrne Sep 06 '09 at 10:22

3 Answers3

2

I had a similar problem running ASP.net 4 side by side with ASP.net 2.0 on Win Server 2003 SP3 and all in 32bit mode.

At some stage something nuked the ASPNET_State from the C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727 directory but had failed to tell the ASPNET_State server that it should now be pointing to C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\ASPNET_State.exe. I can only imagine it was when .Net 4 was installed but I can't be sure.

So I ran

sc config aspnet_state binpath= C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\aspnet_state.exe

and it all seemed to work fine after that.

(Please note the space after 'binpath= ' - I fear the person who made the original post (Mick Byrne) did not put this in and thus explains why... "However this just doesn't work at all and just brings up the usage instructions for this branch of the 'sc' command" - see comments in original post)

DJA
  • 661
  • 1
  • 9
  • 25
  • You might be right... thanks for the extra comments. This problem kept occurring for me for a while - about once every 6 weeks or so - then it just went away. Sorry that I haven't discovered more than just a quick fix for the symptoms, rather than a solution to the underlying problem. – Mick Byrne Mar 09 '11 at 06:40
1

OK, found a solution somewhere else that appears to have worked. Almost the same as the above answer:

  • Go to .NET2.0 directory in command prompt
  • run 'aspnet_regiis -i -enable'
  • computer sits there chewing for a minute and then it all seems to be working.

I checked the 'ASP.NET State Service' in the Services console and it's now pointing to the .NET2.0 version (not the .NET1.1).

The only strange thing I did that may have led to this scenario was to install .NET3.5 straight onto a box that previously only had .NET1.1 installed. I figured it would put .NET2.0 in along the way (which it kind of did), but must have forgotten about the session thing.

Mick Byrne
  • 14,394
  • 16
  • 76
  • 91
0

You can run aspnet_regiis -? From the framework 2.0 directory to update the web site.

Shiraz Bhaiji
  • 64,065
  • 34
  • 143
  • 252
  • This command just outputs the ASP.NET Registration Options. I'm reluctant to trigger a complete re-install of the .NET2.0 framework, as what I have is working well - it's just the session state service that is playing up. – Mick Byrne Sep 06 '09 at 09:36