How to deploy a custom web part?

My web part projects are normally of simple c# class type and if you follow any of my web part examples, you will end up with a project dll. You will use this dll to deploy your web part. In this post I will go over how to deploy a custom we part to your SharePoint server.


I am assuming that you are all done with the development and are now ready to deploy. In this example I have a project name “BirthDaySystem” that I need to deploy.

Deploying the web part
  1. Build the solution
  2. If no error returned by the compiler, copy the DLL from your Birthday project bin > Debug directory to the bin directory of your WSS site (C:InetpubwwwrootwssVirtualDirectories80bin).

  3. Go to (C:inetpubwwwrootwssVirtualDirectories80) and modify the Web.Config file for the WSS site to declare the custom web part as a safe control by adding the following code within the <SafeControls> tag.

 <SafeControl Assembly=”DLL NAME HERE” Namespace=”DLL NAME HERE” TypeName=”*” Safe=”True” />

in my case my dll name is BirthDaySystem; so my webconfig looks like the image below:

Now we can walk through, How to insert this web part in our SharePoint Page?
  1. Go to your root SharePoint site and from there Site Actions -> Site Settings -> Modify All Site Setting.

  2. Under “Galleries” tab click “Web Parts” link.

  3. Add a new web part, Click New menu in web part gallery Page.

  4. Select the newly added web part in the “New Parts Page” and click on “populate gallery”

  5. If the import is successful, you will see the web part in Web part gallery list.

Now we see How to insert into a SharePoint Page?
  1. Go to site under which you previously created the Birthday List. Go to on Site Actions > Create Page
  2. Create a blank web part page and name it BirthDayImportPage
  3. Once the page is created, click on “Add a Web Part”
  4. From the web part list, locate the one we just created and add.
Web Part Properties

This is it! Your deployment is complete. In some cases you need to setup web part properties in order for it to work. If your web part needs its properties set, then:

  1. Click on web part title bar dropdown and select “Modify Web Part”
  2. Modify Shared Web Part will bring up properties panel where you can customize your web part.

Happy Deployment!

9 thoughts on “How to deploy a custom web part?

  1. Hi, follow tour post regarding the web part all things are fine but when i go to deploy it to share point desire web part Hello World can't shown in the web part gallery even dll create successfully and i copy it to desire folder u mention into your post can u please help me in this regard.


    1. mm

      Hi Misbah,

      Can you confirm if you have done the following steps:

      1. Put the DLL in the VirtualDirectories80bin folder.
      2. Modified your Web.config file by adding a safecontrol value for your DLL

  2. mm

    I looked at the web config. Try the following steps:

    1. I see that you have declared two safe control entries for HelloWorld. Please
    remove the second entry (SafeControl Assembly="Helloworld, Version=…..)

    2. Just before the </securityPolicy> tag, enter the following line
    <trustLevel name="Full" policyFile="internal" />

    3. Replace the line <trust level="WSS_Minimal" originUrl="" />
    with <trust level="Full" originUrl="" />

    4. Reset your IIS

    5. Remember that you will not be able to see the webpart in the gallery by
    default. You will have to populate the webpart first. So go to the gallery and
    click "new" and then you should see it in a list.

  3. Misbah here many thanks for help me out for deploying the hello World web part successfully create and deploy the web part can u help me please that if i want to insert data into list through web part .
    your usual favour and response needed.

    Looking forward to hear from you soon


Leave a Reply

Your email address will not be published. Required fields are marked *