Deploying Custom AgilePoint-Enabled ASP.NET Web Pages Developed in Visual Studio 2005 to SharePoint 2007

Applies To

Objective

To provide information about deploying custom ASP.NET Web pages to SharePoint 2007.

Summary

When compiling a Web application in Visual Studio 2005 a dll is not generated that can be deployed to SharePoint to allow for AgilePoint-enabled custom task pages to be hosted in SharePoint. If you have a pre-built Web application using Visual Studio 2005 you can download and install a Visual Studio add-in called "WebDeploymentSetup" to generate the dll that is needed. For a new Web application that needs to generate a dll, you can download a Visual Studio add-in called "WebApplicationProjectSetup" that will create the dll in the same way that Visual Studio 2003 does. 

Resolution

For a pre-built Web application using Visual Studio 2005

If you have a project that is pre-built in Visual Studio 2005 and you need to deploy that dll and aspx pages to SharePoint 2007, you can install an application called "WebDeploymentSetup". This will allow you to generate a dll that you can deploy. To download, go to:  http://download.microsoft.com/download/c/c/b/ccb4877f-55f7-4478-8f16-e41886607a0e/WebDeploymentSetup.msi

 

For instructions on installing go to:   http://msdn2.microsoft.com/en-us/library/aa479568.aspx

Note: If you want to migrate from Visual Studio 2005 Web Site Projects to Visual Studio 2005 Web Application Projects go to this link for directions: http://webproject.scottgu.com/CSharp/migration2/migration2.aspx

To deploy an ASP.NET Web application to SharePoint:

  1. Build your project.
  2. Go to the bin directory of your Web application project and copy the application dll and the Ascentn.Workflow.WebControls.dll.
  3. Paste the dlls to all the SharePoint virtual directories that will be using the aspx pages.
  4. Open the web.config file associated with the SharePoint virtual directory and investigate the trust level tag to ensure that the security level attribute is set to “Full”. If this attribute is not set to full an error may be generated after submitting the aspx page.
    <trust level="Full" originUrl="" />

    NOTE: This change must be done for each of the SharePoint Virtual Directories that will be using the aspx page.

  5. Copy or deploy your Web project to the SharePoint LAYOUTS\AP directory.

    Example: C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\LAYOUTS\AP

    IMPORTANT: Do not copy the cs files.

  6. Open the web.config file at C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\LAYOUTS and paste the following between the <assemblies> tag.

    NOTE: It is recommended to make a backup copy of the web.config file before making any changes.

    NOTE: Make sure there are no duplicates.

    <add assembly="Ascentn.Workflow.WebService, Version=2.0.2.1, Culture=neutral, PublicKeyToken=6404F39064AB2A4E"/>
    
    <add assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71E9BCE111E9429C"/>
    
    <add assembly="Microsoft.SharePoint.Portal, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71E9BCE111E9429C"/>
    
    <add assembly="Ascentn.SharePoint.Common, Version=4.0.0.1, Culture=neutral, PublicKeyToken=2F06EF94BAC0A40F"/>
    
    <add assembly="Ascentn.Workflow.WFBase, Version=2.0.2.1, Culture=neutral, PublicKeyToken=021CA826AE8118AA"/>
  7. Reset IIS.

For a new Web application that needs to generate a dll using Visual Studio 2005

If you are going to build a new Web project in Visual Studio 2005 and need to deploy that dll and aspx pages to SharePoint 2007, you can install an application called "WebApplicationProjectSetup". This will allow you to build a Web application the way that Visual Studio 2003 does.

To download go to: http://msdn2.microsoft.com/en-us/asp.net/aa336618.aspx .

For instructions on installing go to: http://msdn2.microsoft.com/en-us/library/aa730880(VS.80).aspx .

To deploy an ASP.NET Web application to SharePoint use the same steps as detailed above.