Following a comment left elsewhere on this blog, I thought I'd cover exactly what Share Point Solution packages are, including how they are built and deployed to other Share Point environments. Write To File Web ;*** Couple of things to note here.
Other articles on this blog cover the idea of using Share Point Features to deploy functionality, so let's also be clear on the relationship between Features and Solutions. Assuming all the files/references are OK, this results in a file with a extension which will be created in a subfolder under the current directory called 'Package' (the folder will be created for you if it doesn't exist).
In general terms, some of the tasks which cannot be done with a Feature alone but the Feature. We now have a Solution package which can be deployed to another Share Point server.
In actual fact, I always recommend that even if they don't need to be (e.g. But first let's take a peek inside - this can be done by temporarily renaming the extension to
we're not doing anything in the list above), Features are always deployed as part of a Solution. You should then see something like: The final part is to actually deploy the Solution.
The reason for this is that the Solution framework takes care of deploying all required files to all Web Front End (WFE) servers in a Share Point farm. First the file must be copied to the target server, and then we will use STSADM (Share Point's command-line admin tool) to actually deploy the Solution. Write To File Web Part @set PATH=C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN;%PATH% echo --- Attempting to deactivate/retract existing solution...
This alone is incredibly useful in working towards repeatable deployments, and ensures your WFEs stay synchronized. The following are the commands which used to perform the deployment: The first command simply adds the Solution package to Share Point's Solution store in the config database, and the second one actually performs the deployment of the package to the specified web application. Rather than write these commands at the command-line each time you wish to deploy the package, chances are over time you'll package these commands up into STSADM scripts which do the work. Write To File Web Part set url= Web Application set feature Name=COB. stsadm -o deactivatefeature -name %feature Name% -url %url% -force stsadm -o retractsolution -name %solution Name%-url %url% -immediate stsadm -o execadmsvcjobs stsadm -o deletesolution -name %solution Name%-override rem stsadm -o execadmsvcjobs echo --- Adding solution %solution Name% to solution store...
The key file used to specify what a Solution package consists of is the file. As an example, the script I use for the webparts example looks like: :begin @echo off set solution Name=COB. stsadm -o addsolution -filename %solution Name%if errorlevel == 0 goto :deploy Solution echo ### Error adding solution %solution Name% echo .
Going back to my earlier post on deploying web parts, the file for that scenario looks like this: This is assuming the web part is being deployed to the GAC - for this illustration this is a simpler scenario than deploying to the web application's bin directory, where Code Access Security (CAS) policy would also be required. goto end :deploy Solution echo --- Deploying solution %solution Name%...
Effectively, the manifest specifies that the Solution package consists of the following: Importantly, all these details in the file are only used by Share Point when the generated Solution package is deployed. stsadm -o deploysolution -name %solution Name%-url %url% -immediate -allow Gac Deployment -allow Cas Policies -force stsadm -o execadmsvcjobs if errorlevel == 0 goto :activate Feature echo ### Error deploying solution %solution Name% echo .