Previous: Been a while
Next: iPhone developing on hold. Desktop proceeding

Deploying SharePoint 2007 Webparts

 

This article is aimed at those developers who've developed their own SharePoint 2007 webparts in Visual Studio using the wss sdk and want to deploy them to a different server.

1. Build it

The first step is to do a standard Visual Studio deployment of your webpart (F5 or the play button). Once this has happened go to the project folder, then the bin > debug folder.


2. Take it

In here you should have a file along the lines of my_projects.wsp. Take this file and copy it to a folder on one of the web front ends you are deploying on.


3. Script it

Next you need to create two files in the same folder ideally as your .wsp file.

Create a new text document and call it DeploySolution.cmd, then add the following lines to it, replacing my_solution.wsp with your solution name.

 

@setlocal
@pushd.

@set PATH=C:Program FilesCommon FilesMicrosoft Sharedweb server extensions12BIN;%PATH% @cd %~dp0

stsadm.exe -o addsolution -filename my_solution.wsp
stsadm.exe -o deploysolution -name my_solution.wsp -allcontenturls -allowGacDeployment -immediate
stsadm.exe -o execadmsvcjobs

@pause
@popd
@endlocal

 

Once you have done that, create another text document and call it RetractSolution.cmd, then add the following lines to it, again, replacing my_solution.wsp with your solution name.

 

@setlocal
@pushd.

@set PATH=C:Program FilesCommon FilesMicrosoft Sharedweb server extensions12BIN;%PATH% @cd %~dp0

stsadm.exe -o retractsolution -name my_solution.wsp -local -allcontenturls -immediate
stsadm.exe -o deletesolution -name my_solution.wsp
stsadm.exe -o execadmsvcjobs

@pause
@popd
@endlocal

 

Use the first script to deploy your solutions on the server. If you need to update the solution, first use the retract solution script, then re-run the deployment script.

Once you've run the script, you'll most likely have to go into Site Settings > Site Collection Features and turn on the webpart.

Comments

No comments have been added.

Add a comment

0 comments

Latest Tweets

  • @sonnytoiparker http://twitpic.com/2kkard - Which one's Tommy's?

  • @nineplanfailed Sounds like my lunch

  • @nicfranc Have you seen the Epic Citadel demo on iPhone / iPad? oooooooh shiny

  • @LisaMedcalf Dunno what's happening with the house until next week, wankers essentially want me to put a new roof on!

  • @LisaMedcalf Aww cool! I saw a girl on a moped who looked a bit like you and I thought a scooter would be a good idea. Cool, cheap, fun ...

Follow Me