Microsoft KB Archive/827189

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

Article ID: 827189

Article Last Modified on 4/18/2007

-

APPLIES TO


 * Microsoft ASP.NET 1.1
 * Microsoft ASP.NET 1.0
 * Microsoft .NET Framework Software Development Kit 1.0 Service Pack 2

-





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.



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.



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



STATUS
This behavior is by design.



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

http://www.microsoft.com/downloads/details.aspx?FamilyID=1001aaf1-749f-49f4-8010-297bd6ca33a0&DisplayLang=en

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

http://msdn2.microsoft.com/en-us/netframework/aa731542.aspx

Create a New ASP.NET Web Application
 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. Add a TextBox control and two Button controls to WebForm1.aspx.  Add the following code to the Button_click event of the Button1 control:

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

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

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:  In Solution Explorer, double-click the Web.config file to edit the file.</li>  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: <system.web> <sessionState  mode=&quot;StateServer&quot; stateConnectionString=&quot;tcpip=localhost:42424&quot; /> </system.web> Note If the state service is running on the remote computer, type the remote computer name instead of localhost. </li> Save and then close the Web.config file.</li> On the Build menu in Microsoft Visual Studio, click Build Solution.</li> To start the ASP.NET State Service, follow these steps:  Click Start, point to Programs, point to Administrative Tools, and then click Services.</li> In the right pane of the Services window, right-click the ASP.NET State Service service, and then click Start.</li></ol> </li> To run the ASP.NET application, follow these steps:  In a Web browser, type the following URL:

http:// /StateServ/WebForm1.aspx

</li> In the box, type This text is from the session variable. </li> To assign the text in the box to the session variable, click the Button1 control.</li> To display the text that is stored in the session variable, click the Button2 control.</li></ol> </li> To stop the ASP.NET State Service, follow these steps: <ol style="list-style-type: lower-alpha;"> <li>Click Start, point to Programs, point to Administrative Tools, and then click Services.</li> <li>In the right pane of the Services window, right-click the ASP.NET State Service service, and then click Stop.</li></ol> </li></ol>

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

http://msdn2.microsoft.com/en-us/netframework/aa569282.aspx

Start the State Service
To start the ASP.NET State Service, follow these steps: <ol style="list-style-type: lower-alpha;"> <li>Click Start, point to Programs, point to Administrative Tools, and then click Services.</li> <li>In the right pane of the Services window, right-click the ASP.NET State Service service, and then click Start.</li></ol>

You receive the error message that is mentioned in the &quot;Symptoms&quot; section of this article.

<div class="references_section">