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.
- Build the solution
- 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).
- 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:
- Go to your root SharePoint site and from there Site Actions -> Site Settings -> Modify All Site Setting.
- Under “Galleries” tab click “Web Parts” link.
- Add a new web part, Click New menu in web part gallery Page.
- Select the newly added web part in the “New Parts Page” and click on “populate gallery”
- If the import is successful, you will see the web part in Web part gallery list.
- Go to site under which you previously created the Birthday List. Go to on Site Actions > Create Page
- Create a blank web part page and name it BirthDayImportPage
- Once the page is created, click on “Add a Web Part”
- From the web part list, locate the one we just created and add.
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:
- Click on web part title bar dropdown and select “Modify Web Part”
- Modify Shared Web Part will bring up properties panel where you can customize your web part.