Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

PRB: "Could Not Start the ASP.NET State Service on Local Computer" Error Message When You Try to Run an ASP.NET Application with the ASP.NET State Service


View products that this article applies to.

Symptoms

You install the Microsoft .NET Framework 1.1, and then you install the .NET Framework 1.0 Service Pack 2 (SP2) on a computer that is running Microsoft Windows 2000 with Service Pack 4 (SP4). When you try to run a Microsoft ASP.NET application, you may receive the following error message:
Could not start the ASP.NET State Service service on Local Computer.
Error 1069: The service did not start due to a logon failure.

↑ Back to the top


Cause

When the .NET Framework 1.0 is installed after the .NET Framework 1.1 is installed, the password changes for the ASPNET account that the ASP.NET state service uses. Therefore, an error occurs when the ASP.NET application uses the ASP.NET state service.

↑ Back to the top


Workaround

When you install the .NET Framework version 1.0 after you install the .NET Framework version 1.1, you may modify the password for the ASPNET account that the ASP.NET state service uses. To do this, locate the %windir%\Microsoft.NET\Framework\v1.1.4322 folder at the command prompt, and then type the following command:
aspnet_regiis.exe -ir

↑ Back to the top


Status

This behavior is by design.

↑ Back to the top


More information

Steps to Reproduce the Behavior

Install Windows 2000 SP4

If Windows 2000 SP4 is not already installed on your Windows 2000-based computer, visit the following Microsoft Web site:

Install the .NET Framework 1.1

To download and to install the .NET Framework 1.1, visit the following Microsoft Web site:

Create a New ASP.NET Web Application

  1. Create a new ASP.NET Web application by using Microsoft Visual C# .NET or Microsoft Visual Basic .NET. Name the project StateServApp. By default, WebForm1.aspx is created.
  2. Add a TextBox control and two Button controls to WebForm1.aspx.
  3. Add the following code to the Button_click event of the Button1 control:

    Visual C# .NET
    Session["var1"]=TextBox1.Text;		
    Visual Basic .NET
    Session("var1")=TextBox1.Text		
  4. Add the following code to the Button_click event of the Button2 control:

    Visual C# .NET
    Response.Write("Value retrieved from the Session Variable: " + Session["var1"])
    Visual Basic .NET
    Response.Write("Value retrieved from the Session Variable: " + Session("var1"))

Configure the State Service

By default, ASP.NET stores the session state in the same process that processes the request. Additionally, ASP.NET stores the session data in an external process such as aspnet_state. To enable this feature, follow these steps:
  1. In Solution Explorer, double-click the Web.config file to edit the file.
  2. Set the mode attribute of the <sessionState> section to StateServer, and then configure the stateConnectionString attribute with the following values of the computer where you started aspnet_state:
    <configuration>
     <system.web>
      <sessionState   mode="StateServer"
        stateConnectionString="tcpip=localhost:42424"
      />
     </system.web>
    </configuration>
    Note If the state service is running on the remote computer, type the remote computer name instead of localhost.
  3. Save and then close the Web.config file.
  4. On the Build menu in Microsoft Visual Studio, click Build Solution.
  5. To start the ASP.NET State Service, follow these steps:
    1. Click Start, point to Programs, point to Administrative Tools, and then click Services.
    2. In the right pane of the Services window, right-click the ASP.NET State Service service, and then click Start.
  6. To run the ASP.NET application, follow these steps:
    1. In a Web browser, type the following URL:
      http://localhost/StateServ/WebForm1.aspx
    2. In the box, type This text is from the session variable.
    3. To assign the text in the box to the session variable, click the Button1 control.
    4. To display the text that is stored in the session variable, click the Button2 control.
  7. To stop the ASP.NET State Service, follow these steps:
    1. Click Start, point to Programs, point to Administrative Tools, and then click Services.
    2. In the right pane of the Services window, right-click the ASP.NET State Service service, and then click Stop.

Install the .NET Framework 1.0 SP2

To download and to install the .NET Framework 1.0 SP2, visit the following Microsoft Web site:

Start the State Service

To start the ASP.NET State Service, follow these steps:
  1. Click Start, point to Programs, point to Administrative Tools, and then click Services.
  2. In the right pane of the Services window, right-click the ASP.NET State Service service, and then click Start.
You receive the error message that is mentioned in the "Symptoms" section of this article.

↑ Back to the top


References

For additional information, click the following article number to view the article in the Microsoft Knowledge Base:
307598 INFO: ASP.NET State Management Overview


For more information, visit the following Microsoft Web sites:

↑ Back to the top


Keywords: KB827189, kbprb, kbconfig, kbweb, kbstate

↑ Back to the top

Article Info
Article ID : 827189
Revision : 9
Created on : 4/18/2007
Published on : 4/18/2007
Exists online : False
Views : 658