Skip to content
September 29, 2007 / red1s

HOW TO: DEPLOY A SHAREPOINT WEBPART


We are going to use a Visual Studio setup project to accomplish this, so add a new project to the same solution your Web part project is in, and create a CAB setup project. I called my setup project SetupNewsAnnouncementRotator.”

image

Right click on the project and goto Add -> Project Output, from the ‘Add Project Output Group’ dialog box, select your Web Part project and then select ‘Primary Output’.

image

Repeat the step above but this time instead of selecting ‘Primary Output’ select ‘Content Files’.

After this is done you should have a solution that looks something like this:

 image

Now you can compile your setup project ensuring that Visual Studio is set to release mode, this will create a cab file containing the WebPart assembly and the manifest.xml file so all we need to do now to create our SharePoint solution file is rename our .cab file to .wsp.

We are now ready to deploy this solution file into SharePoint and we do this by using the STSADM.exe tool. This tool is located in your SharePoint installation directory under the bin folder mine was located here C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN. I strongly suggest you add this path to you PATH environment variable for ease of use.

You need to use the addsolution argument to the STSADM tool the first time you deploy a Web Part into your SharePoint site. When updating the Web Part you can use the upgradesolution argument.

The following is how I deployed my Web Part into my SharePoint site for the first time.

Great! Your Web Part is now deployed into your SharePoint site, or is it?

We need to do one more thing to make out Web Part available to our SharePoint site.

Open up Central Administration and navigate to ‘Operations’ under ‘Global Configuration’ click ‘Solution Management’. You should see your Web Part Solution sitting in the list with ‘Not Deployed’ as it’s status. Click on the Solution and click the ‘Deploy Solution’ button.

You should now be able to add your Web Part to any sites Web Part gallery.

Hope this guide has been useful, it’s quite a lengthy process do first time, but should get easier the more times you do it.

Digg This

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: