Question

Has any one tried to version WSP in SharePoint 2010?

Thanks,

Was it helpful?

Solution

It would help to be a bit more specific that ".wsp" in your question.

As Flo mentioned - if you keep the assembly version the same but change the AssemblyFileVersion then you can upgrade the assemblies in your WSP solution using

STSADM -o upgradesolution ...

See my answer on SO - How can I use wildcard assembly versioning?

This will suffice for webparts but if you've got other artifacts and are using things like Feature things like event receivers then you may have to retract and re-deploy.

OTHER TIPS

Thanks all for your replies. I have two concerns:

a. Assume my wsp is deploying a webpart with assembly version as 1.0.0.0 and assembly file version is also 1.0.0.0. Now after few days i need to deploy a recent version of webpart. The assembly version now will be 2.0.0.0 and assembly file version will also be 2.0.0.0. I have noticed that even if i retract and redeploy the wsp, the .webpart files that sits in the web part gallery always shows assembly version as 1.0.0.0. I guess this is because wsp retraction will not delete the .webpart file and neither feature deactivation. So the only option that remains is to write feature deactivation code to delete the .webpart file from webpart gallery. This will be largely in efficient as i will need to iterate through all the site collections of deployed webapplication to determine from the code ( a windows form as installer) the site collection where feature is activated and deactivate the same.

b. I need to query the webpart dll version for some operation. I was thinking it will be good if we can version wsp and keep the wsp version same as the web part dll. This will help me to remain in the SharePoint context to determine the web part dll version ( rather than querying the dll to find the version).

Thanks

WSP don't really version.
You can however version components into it:

  • Feature or WebParts via different names (FeatureV1, FeatureV2...)
  • Assembly using standard assembly versioning (WebpartV1 use assembly 1.0.0, WebPartV2 use 1.1.0 and so on)
  • ...
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top