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.
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
- Click Start, click Administrative
Tools, and then click SharePoint Central
- In the Virtual Server Configuration area,
click Configure virtual server settings.
- On the Virtual Server List tab, click the
virtual server that you have to add the excluded paths to.
- Under Virtual Server Management, click
Define Managed Paths.
- In the Add a New Path section, type the
path that you want to exclude in the Path box.
- Click Excluded Path, and then click
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:
Important: These modifications are the most open and unrestricted variations. They should be evaluated closely and carefully assessed before using them in a production environment.
- 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
- Open the Web.config file.
- Locate the <system.web> tag, and then add the
following code under the tag:
<!-- Setup the PageHandlerFactory to process all requests. This will override the SharePoint HTTPHandler. -->
<add verb="*" path="*.aspx" type="System.Web.UI.PageHandlerFactory, System.Web, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<!-- Set the trust back to Full. WSS configures a very restrictive trust policy that does not allow most applications to run correctly. -->
<trust level="Full" originUrl="" />
Enable the modules that you must have for your program to run.
If you receive the following message:
Parser Error Message: The module '<moduleName>' is already in the program and cannot be added again
You can remove the modules that are mentioned in the error message. The SharePoint web.config already includes the module for OutputCache and WindowsAuthentication so you do not have to add them here.
<add name="Session" type="System.Web.SessionState.SessionStateModule"/>
<add name="FormsAuthentication" type="System.Web.Security.FormsAuthenticationModule"/>
<add name="PassportAuthentication" type="System.Web.Security.PassportAuthenticationModule"/>
<add name="UrlAuthorization" type="System.Web.Security.UrlAuthorizationModule"/>
<add name="FileAuthorization" type="System.Web.Security.FileAuthorizationModule"/>
<!-- Enable Session for the pages -->
<pages enableSessionState="true" enableViewState="true" enableViewStateMac="true" validateRequest="false" />
- 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:
to create the Web.config file for an ASP.NET application
- 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:
For additional information about canonicalization issues with ASP.NET, click the following article numbers to view the articles in the Microsoft Knowledge Base:
- Open the Web.config file.
- 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="ValidatePathModule" type="Microsoft.Web.ValidatePathModule, Microsoft.Web.ValidatePathModule, Version=188.8.131.52, Culture=neutral, PublicKeyToken=eba19824f86fdadd"/>
- Save the Web.config file.
HTTP module to check for canonicalization issues with ASP.NET
How to programmatically test for canonicalization issues with ASP.NET
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
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.
This problem occurs because all requests to access the
virtual server are intercepted by Windows SharePoint Services or by SharePoint Portal Server 2003.
Article ID: 828810 - Last Review: February 25, 2009 - Revision: 6.0
- Microsoft Windows SharePoint Services 2.0
- Microsoft Office SharePoint Portal Server 2003
- Microsoft Office SharePoint Server 2007
|kbtshoot kbprb kbwebservices kbconfig kbnetwork kberrmsg KB828810|