Skip to content

November 23, 2005

How To Setup SharePoint for Visual Studio Web Projects

SharePoint makes changes to the Visual Studio configuration and applies it’s own ISAPI filter that prevent visual studio from opening web projects without some special configuration.  This document describes the process that you must do to be able to open a Visual Studio web project.

Once for the Server

The following process, which establishes a MIME type for the .tmp files that Visual Studio uses is required to be done only once for the server irrespective of the number of virtual servers that have been extended with SharePoint or the number of web applications that you want to use.

This process was extracted from the “Getting Started with Customizing a SharePoint Web Site in Visual Studio .NET” topic in the SharePoint SDK.

1)      Click the Start button, then Administrative Tools, and finally Internet Information Services (IIS).  (If you don’t have Administrative Tools on your menu you can click Control Panel.  Administrative Tools is always listed in control panel.)

2)      In the left pane expand the branches until Web Sites is showing.

3)      Right click Web Sites and select Properties from the context menu.

4)      Click the HTTP Headers tab

5)      Click the MIME Types button.

6)      Click the New button

7)      In the Extension text box type .tmp

8)      In the MIME type text box type common/type

9)      Click OK until you’re back at the main Internet Information Services (IIS) Manager console.

10)  Close the console.

Now that the server is configured for .tmp files it’s time to proceed to the steps that must be completed for each Visual Studio web project or IIS/SharePoint Virtual Server.

For Each Project

There are two basic steps that must be completed for each project: 1) Creating the exclusion in SharePoint.  2) Creating the virtual directory in IIS.  This section of the “how to” details each of these two basic operations.

Creating the Exclusion in SharePoint

By default, SharePoint handles all URLs and because of this non-SharePoint solutions on the server can not be reached.  The process of defining a managed path is detailed in a separate “how-to” document – How to Define a Managed Path Exclusion.

There must be a managed path (exclusion) for every directory that you want to use for a Visual Studio Web Project.

Creating the Virtual Directory in IIS

Now that you have created the managed path exclusions for the web projects you’re ready to create the virtual directories so that the web projects are in the same hierarchy as they occur in VSS.  This helps to reduce the number of path change-based issues that occur as files are checked in and out on different machines.  In order to get things setup correctly, follow these steps:

1)      Go to the parent directory of the project (as it is in VSS).

2)      Create a folder with the name of the web project.

3)      Click Start, then Administrative Tools, then Internet Information Services (IIS) Manager.

4)      Expand the web site that you need to add the web project to.

5)      Right click the web site, select New from the context menu and then Virtual Directory.

6)      On the welcome screen click the Next button.

7)      In the Alias text box enter the name of the virtual directory.

8)      Click the Next button.

9)      In the Path text box enter the full path for the folder you created in step 2.

10)  Click the Next button

11)  Check the Run scripts (such as ASP) checkbox.

12)  Click the Next button.

13)  Click the Finish button.

14)  Close Internet Information Services (IIS) Manager.

15)  Delete the folder you created in step 2 from the file system.

Opening the File in Visual Studio

Now that you have the folders setup all that is left is to open the solution in SharePoint and have it open the projects.  Follow these steps:

1)      Open Visual Studio and select File, Source Control, Open from Source Control.

2)      Enter the folder for the solution in the Create a new project in folder: text box provide the local path for the solution.

3)      Select the project to open in the SourceSafe project to download: tree view.

4)      Click OK.

5)      Click OK when prompted for locations for the web projects.

You have now setup a Visual Studio Web project on a SharePoint server.

How to Define a Managed Path Exclusion

SharePoint takes over all of the directories on the server so that it can create a dynamic, configuration-based, solution.  However, this creates problems when other projects or data must share the same space.  This document describes the steps necessary to create an exclusion so that non-SharePoint projects can co-exist on the same server.

Defining the Managed Path

To define the managed path follow this procedure:

  1. On the Start menu select Administrative Tools, and then SharePoint Central Administration
  2. In the Virtual Server Configuration section, click the Configure virtual server settings link.
  3. Select the virtual server that you’re interested in from the Virtual Server List.  This should be the web site that you’re going to put non-SharePoint content in.
  4. In the Virtual Server Management section, click the Define managed paths link.
  5. In the Add New Path section there is a Path text box.  In this text box, enter the path that you want to exclude.
  6. In the Type radio button list click Excluded Path.
  7. Click the OK button.
  8. Verify that the URL you selected is now listed in the Excluded Paths section.
  9. Repeat steps 5-8 for each URL you need to exclude.

You’ve now defined a managed path in SharePoint.  SharePoint will no longer try to service requests to those URLs and as a consequence the other application or content that you’ve placed in this directory should now be available.

Article: Master Advanced List Editing in SharePoint

SharePoint’s built-in tools are good at providing a basic interface for adding and editing data, however, there are times when the included editing features aren’t enough. There are applications where the SharePoint list will work, except for one small detail. For instance, you may need to ensure that one of the fields in your list matches a back-end data source. This might be accomplished by creating a drop-down that is populated from a back-end system, or perhaps it’s some custom validation that ensures that the data that the user enters is in the back-end system.

Tearing open SharePoint to find a facility for these additional features is difficult. It requires an understanding of how SharePoint works overall as well as how it handles drawing a list. However, by the end of this article you’ll understand the overall architecture, the details that make it work, and you’ll have a framework for creating your own custom list editing solution.

One Little, Two Little, Three Little Web Parts
You know that SharePoint is built on Web parts, however, the extent to which SharePoint utilizes Web Parts internally may surprise you. Nearly every page that you see in SharePoint—from the default.aspx on every site to the forms pages at the heart of each list—is a Web Part Page.

Recent Posts

Public Speaking