Microsoft KB Archive/828810

= How to enable an ASP.Net application to run on a SharePoint virtual server =

Article ID: 828810

Article Last Modified on 1/19/2007

-

APPLIES TO


 * Microsoft Windows SharePoint Services
 * Microsoft Office SharePoint Portal Server 2003
 * Microsoft Office SharePoint Server 2007

-





SUMMARY
This article describes how to configure an ASP.NET application to run on a virtual server that is running Microsoft Windows SharePoint Services or Microsoft Office SharePoint Portal Server 2003.



MORE INFORMATION
To enable an ASP.NET application to run on a server that is running Windows SharePoint Services or SharePoint Portal Server 2003, configure an exclusion for the application path on the virtual server. The exclusion tells the server that is running SharePoint Portal Server 2003 not to intercept the request to access the virtual server and to let the Microsoft Internet Information Services (IIS) server to handle the request.

Note In Office SharePoint Server 2007, you do not have to configure an exclusion. However, you should create a virtual directory by using Internet Information Services Manager. Additionally, you should configure the virtual directory as an application. The application should have a corresponding Web.config file.

To create an exclusion for a part of the URL namespace of the virtual server, follow these steps:
 * 1) Click Start, click Administrative Tools, and then click SharePoint Central Administration.
 * 2) In the Virtual Server Configuration area, click Configure virtual server settings.
 * 3) On the Virtual Server List tab, click the virtual server that you have to add the excluded paths to.
 * 4) Under Virtual Server Management, click Define Managed Paths.
 * 5) In the Add a New Path section, type the path that you want to exclude in the Path box.
 * 6) Click Excluded Path, and then click OK.

Sometimes, you have to do more than just set the Excluded path. Some Web programs require that you modify the Web.config file for the server that is running Windows SharePoint Services or SharePoint Portal Server 2003. To modify the Web.config file, follow these steps:  On the server that is hosting the Web page that you want to configure, locate the path that was excluded from the steps that are earlier in this article. The path will be similar to the following:



 Save a backup copy of the Web.config file as Web2.config. Open the Web.config file.  Locate the  tag, and then add the following code under the tag:   



<httpModules> <add name=&quot;Session&quot; type=&quot;System.Web.SessionState.SessionStateModule&quot;/> <add name=&quot;FormsAuthentication&quot; type=&quot;System.Web.Security.FormsAuthenticationModule&quot;/> <add name=&quot;PassportAuthentication&quot; type=&quot;System.Web.Security.PassportAuthenticationModule&quot;/> <add name=&quot;UrlAuthorization&quot; type=&quot;System.Web.Security.UrlAuthorizationModule&quot;/> <add name=&quot;FileAuthorization&quot; type=&quot;System.Web.Security.FileAuthorizationModule&quot;/> </httpModules>

<pages enableSessionState=&quot;true&quot; enableViewState=&quot;true&quot; enableViewStateMac=&quot;true&quot; validateRequest=&quot;false&quot; /> </li> Save the Web.config file.

For additional information about how to create a Web.config file to use with ASP.NET, click the following article number to view the article in the Microsoft Knowledge Base:

815179 How to create the Web.config file for an ASP.NET application

</li> Install the HTTP module that is discussed in Microsoft Knowledge Base article 887289 to look for canonicalization issues with ASP.NET. After you install the module, add the module reference to your Web.config file for your ASP.NET application that resides under an excluded path of the SharePoint Portal Server 2003 virtual server.

Note The module does not have to be added to the Web.config file that SharePoint Portal Server 2003 uses at the root of the virtual server.

To add the module reference to your ASP.NET application's Web.config file, follow these steps: <ol style="list-style-type: lower-alpha;"> Open the Web.config file.</li>  Locate the <httpModules> entries inside the <system.web> section that you added in step 4, and then add the following code after the last entry: <add name=&quot;ValidatePathModule&quot; type=&quot;Microsoft.Web.ValidatePathModule, Microsoft.Web.ValidatePathModule, Version=1.0.0.0, Culture=neutral, PublicKeyToken=eba19824f86fdadd&quot;/> </li> Save the Web.config file.</li></ol>

For additional information about canonicalization issues with ASP.NET, click the following article numbers to view the articles in the Microsoft Knowledge Base:

887289 HTTP module to check for canonicalization issues with ASP.NET

887459 How to programmatically test for canonicalization issues with ASP.NET

</li></ol>

Note If you do not create the exclusion for the virtual server, Windows SharePoint Services or SharePoint Portal Server 2003 will return one of the following error messages when you try to visit any one of the pages that is located on the file system:

The page cannot be found

HTTP 404 - File not found

Error

A Web Part on this Smartpage cannot be displayed because it is not registered on this site as a safe Web Part.

Troubleshoot issues with Microsoft SharePoint.

Note This problem occurs because all requests to access the virtual server are intercepted by Windows SharePoint Services or by SharePoint Portal Server 2003.

Additional query words: STS SPS WSS WSSv3 MOSS2007

Keywords: kbtshoot kbprb kbwebservices kbconfig kbnetwork kberrmsg KB828810

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.