How to enable an ASP. NET application to run on a Sharepoint Virtual Server

Source: Internet
Author: User
Tags knowledge base
Form: http://support.microsoft.com /? Id = 828810

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.

NoteIn Office Sharepoint Server 2007, you do not have to configure an exclusion. however, you shoshould create a virtual directory by using Internet Information Services Manager. additionally, you should configure the virtual directory as an application. the application shoshould 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. ClickStart, ClickAdministrative Tools, And then clickSharePoint Central Administration.
2. InVirtual Server ConfigurationArea, clickConfigure virtual server settings.
3. OnVirtual Server LISTTab, click the virtual server that you have to add the excluded paths.
4. UnderVirtual Server Management, ClickDefine managed paths.
5. InAdd a new pathSection, type the path that you want to exclude inPathBox.
6. ClickExcluded path, And then clickOK.

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:

1. 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:

Drive: \ Inetpub \ wwwroot \Excluded path
2. Save a backup copy of the web. config file as web2.config.
3. Open the Web. config file.
4. 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. --> 

5. 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:

815179Http://support.microsoft.com/kb/815179)How to create the Web. config file for an ASP. NET application
6. 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.

NoteThe 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:

A. Open the Web. config file.
B. Locate the

<Add name = "validatepathmodule" type = "Microsoft. Web. validatepathmodule, Microsoft. Web. validatepathmodule, version = 1.0.0.0, culture = neutral, publickeytoken = eba191_f86fdadd"/>

C. Save the Web. config file.

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

887289Http://support.microsoft.com/kb/887289) HTTP module to check for canonicalization issues with ASP. NET 887459 Http://support.microsoft.com/kb/887459) How to programmatically test for canonicalization issues with ASP. NET

NoteIf 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 founderror
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.

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

Add the following directives in the web. config file of the Web application between the <system. Web> tag and the </system. Web> tag:

 <! --   
Clear out the wss asp. NET handler and specify the default ASP. NET handler for all pages.
-->

< Httphandlers >
< Clear />
< Add Verb = "*" Path = "*. Aspx" Type = "System. Web. UI. pagehandlerfactory, system. Web,
Version = 1.0.5000.0, culture = neutral, publickeytoken = b03f5f7f11d50a3a"   />
</ Httphandlers >

<! --  
Set the Trust to full. WSS configures a very restrictive trust policy that does not
Allow ASP. NET web application to run correctly.
-->

< Trust Level = "Full" Originurl = ""   />

<! --  
Enable the session module. This can also be enabled on the WSS web. config,
But is not enabled by default. If you receive the following message:
Parser error message: the module 'session 'is already in the Application
And cannot be added again. You can remove the following
<Httpmodules> On the virtual server.
-->  

< Httpmodules >
< Add Name = "Session" Type = "System. Web. sessionstate. sessionstatemodule" />
</ Httpmodules >  

<! -- Enable session State for all the pages in the Web application. -->  
< Pages Enablesessionstate = "True" Enableviewstate = "True"  
Enableviewstatemac = "True" Validaterequest = "False"   />
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.