Configure and deploy a Web Part to the Bin folder manually (Office SharePoint Server)

Applies To: Office SharePoint Server 2007

This Office product will reach end of support on October 10, 2017. To stay supported, you will need to upgrade. For more information, see , Resources to help you upgrade your Office 2007 servers and clients.

 

Topic Last Modified: 2007-10-26

Once a developer has created a Web Part by using Microsoft Visual Studio, you copy the finished .dll file to the Bin directory in your Web application root directory.

The Bin directory is a partial trust location. By default, code that runs from this directory has a low level of code access security permissions. You should explicitly raise permissions granted to the Web Part so that it can function properly.

Manually configure and deploy a Web Part

  1. Copy the <YourWebPartName>.dll assembly in the project's Bin directory to the Bin directory in your Web application root directory.

  2. Locate the Web.config file in your application root directory and open it for editing.

  3. Add the following safe-control entry for your custom assembly to the Web.config file:

    <SafeControl Assembly=" YourWebPartName, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" Namespace=" YourWebPartNamespace" TypeName="*" Safe="True" AllowRemoteDesigner="True"/>

Every Web Part should have a .webpart file, which is an XML file that describes the Web Part. The .webpart file also causes your Web Part to appear in the Web Part gallery. The following procedure describes the easiest way to create a .webpart file after you deploy your Web Part and register it in the Safe Control list.

Add a component to the Web Part gallery

  1. To create a .webpart file, navigate to http://MyServer/_layouts/newdwp.aspx, where MyServer is the name of the server on which your SharePoint site is deployed.

  2. Select the check box beside <YourWebPartNamespace>.<YourWebPartName>.

  3. Click Populate Gallery to add the YourWebPartName Web Part to the Team Site gallery.

  4. Select Edit in the Web Part gallery to edit the Web Part, and then click Export.

    You are prompted to provide a location in which to put the .webpart file. You can also export ASP.NET 2.0 Web Parts and import them to SharePoint sites.

See Also

Concepts

Configure and deploy secure Web Parts to your server (Office SharePoint Server)