This site is a self-contained low down on what's going on in my life, what I'm working on, what I'm thinking about, and how I'm feeling about life in general.
Thursday, 31 July 2008
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.
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.
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.
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.