views:

36

answers:

3

I have a webpart deployed as a feature. Upon activation reads a value from feature.xml property bag. Lets say in future I want to change the value in the feature propery bag and update the web part. Is it possible to do it without undeploy the whole package update the feature.xml and re deploy the wsp. All I want to do is update the feature.xml and trigger the featureactivated event, so that web part gets updated.

+1  A: 

You don't have to undeploy the wsp, there is an upgrade functionality that you can use. for instance, in stsadm -o upgradesolution

Vladi Gubler
+1  A: 

The most complete thing to do would be to script the following for your solution

STSADM --o upgradesolution // This will update the feature.xml in place

STSADM -o execadmsvcjobs // make sure the solution upgrade has run

STSADM -o deactivatefeature // deactivate the feature

STSADM -o activatefeature // reactivate the feature reading the new value

STSADM -o execadmsvcjobs // run again for the impatient

Tools like WSPBuilder and STSDEV for Visual Studio will help here. For WSPBuilder the command is in Tools > WSPBuilder > Upgrade Solution and for STSDEV it is the Upgrade build target option. Not sure about Vsewss or things like SPVisualDev though.

Junx
A: 

You do not have to redeploy the WSP package at all. If you change the feature.xml on all front-end servers and then re-activate the feature it will do the trick.

But be aware that this is not a good way to do it because you surely will loose that modification next time you deploy the WSP package again. Or to turn it around when you retract and then deploy the WSP package again you have removed the manual change you made to the feature.xml files earlier. That is because SharePoint has a copy of the WSP package in its solution store. So when working with WSP packages it is the clean approach to get all modifications in the WSP package and redeploy it. That also makes sure that the changes are applied to all front-end servers. Also when a new front-end server should be add to the farm at a later stage!

Kr., Bernd.

Bernd