Microsoft KB Archive/894903

= You receive a &quot;The Windows SharePoint Services virtual server has not been configured for use with ASP.NET 2.0.xxxxx.0&quot; error message when you connect to the home page of a Windows SharePoint Services Web site =

Article ID: 894903

Article Last Modified on 9/7/2006

-

APPLIES TO


 * Microsoft Windows SharePoint Services

-



SYMPTOMS
Consider the following scenario. You install Microsoft Windows SharePoint Services on a server. Microsoft Internet Information Services (IIS) 6.0 is configured for use with Microsoft ASP.NET 2.0 on that server. When you connect to the home page of a Windows SharePoint Services Web site, you receive the following error message:

The Windows SharePoint Services virtual server has not been configured for use with ASP.NET 2.0.xxxxx.0. For more information, please refer to Knowledge Base article 894903 at http://go.microsoft.com/fwlink/?linkid=42660.

Note that the xxxxx in ASP.NET 2.0.xxxxx.0 indicates the version of ASP.NET 2.0 that you are running.



CAUSE
ASP.NET 2.0 implements a new security change that helps lock down security for a virtual server in IIS 6.0. In earlier versions of ASP.NET, code runs at the trust level that is assigned to it. The trust level is determined by the code access security policy file. The Wss_minimaltrust.config file is an example of a code access security policy file that is specified in the Web.config file.

The new security change in ASP.NET 2.0 restricts the permissions of Web pages, Web parts, and controls to the intersection between the ASP.NET PermissionSet and the trust level at which the code runs. In this configuration, the ASP.NET PermissionSet is a declarative representation of a PermissionSet instance. By default, Windows SharePoint Services gives only minimal privileges to the ASP.NET PermissionSet. The security change that is implemented in ASP.NET 2.0 causes some code to run with reduced privileges. For example, code from assemblies in the global assembly cache previously ran at a full-trust level. When you configure the virtual server in IIS 6.0 to use ASP.NET 2.0, the code runs with the privileges that are assigned to the ASP.NET PermissionSet. The lockdown is incompatible with Windows SharePoint Services. Therefore, the lockdown must be disabled in the Web.config file.

ASP.NET 2.0 also includes a new capability called event validation. Event validation monitors callbacks to the ASP.NET infrastructure to make sure that the source of a callback equals the control target. Some Windows SharePoint Services pages use callbacks that are not associated with a particular control. Callbacks that are not associated with a particular control can cause page execution errors. Therefore, Windows SharePoint Services 2.0 is not compatible with the ASP.NET 2.0 event validation capability. When you configure a Windows SharePoint Services-extended Web application on a server that has ASP.NET 2.0 installed, you must turn off ASP.NET 2.0 event validation.



RESOLUTION
Use the Windows SharePoint Services Stsadm.exe command-line tool to update the settings in the Web.config file. To do this, use the following command:

stsadm -o upgrade -forceupgrade -url http:// 

The command updates the Web.config file that is located in the root folder of the virtual server. For example, the command updates the Web.config file that is located in the :\Inetpub\Wwwroot folder. The upgrade operation makes the following changes:  The command adds the processRequestInApplicationTrust attribute to the following trust tag:



After you run the command, the trust tag appears as follows:



 The command adds the following element under the pages tag:



 The command adds anenableEventValidation attribute to the tag, where the original tag is as follows:



After the attribute has been added, the tag is as follows:

 

</ul>

<div class="moreinformation_section">

MORE INFORMATION
If you change the version of ASP.NET that the virtual server uses from ASP.NET 2.0 to ASP.NET 1.1, you must use the Stsadm.exe command-line tool to update the settings in the Web.config file. To do this, use the following command:

stsadm -o upgrade -forceupgrade -url http:// 

The command removes the elements that were previously added to the Web.config file. That is, the following changes are made to the Web.config file: <ul> The command removes the processRequestInApplicationTrust attribute from the following trust tag:

<trust level=&quot;WSS_Minimal&quot; originUrl=&quot;&quot; processRequestInApplicationTrust=&quot;false&quot; />

After you run the command, the trust tag appears as follows:

<trust level=&quot;WSS_Minimal&quot; originUrl=&quot;&quot; />

</li> The command removes the following element that is under the pages tag:

<remove namespace=&quot;System.Web.UI.WebControls.WebParts&quot; />

</li></ul>

If you do not run the command after you configure the virtual server to use ASP.NET 1.1, you receive the following error message:

Server Error in '/' Application.

Or, if the CustomErrors feature is enabled, you receive the following error message:

Unrecognized attribute 'processRequestInApplicationTrust'.

Source Error:

<pre class="fixed_text">Line 66:    <compilation batch=&quot;false&quot; debug=&quot;false&quot; /> Line 67:    <pages enableSessionState=&quot;false&quot; enableViewState=&quot;true&quot; enableViewStateMac=&quot;true&quot; validateRequest=&quot;false&quot; /> Line 68:    <trust level=&quot;WSS_Medium&quot; originUrl=&quot;&quot; processRequestInApplicationTrust=&quot;true&quot;/> Line 69:    <machineKey validationKey=&quot;A4CE4E781E8FCF0763F6D8309BB2394532B29E2DA9DD555F&quot; decryptionKey=&quot;2AF183D38F95610298659AB9E30B9B1B4AC6A6D362D8D5F7&quot; validation=&quot;SHA1&quot; /> Line 70:  </system.web> Source File: c:\inetpub\wwwroot\web.config   Line: 68

<div class="references_section">