Thursday, February 10, 2011

Stsadm upgradesolution vs. deploysolution

upgradesolution != deploysolution

There are certain times when you can use upgradesolution, primarily only when you haven't added or removed any files from the project. 

The list of the constraints for when you cannot use stsadm –o upgradesolution:
  • The following operations are not supported in solution upgrade.
  • Removing old Features in a new version of a solution.
  • Adding new Features in a solution upgrade.
  • Updating or changing the receiver assembly for existing Features in a new version of a solution.
  • Adding or changing Feature elements (Element.xml files) in a new version of a solution.
  • Adding or changing Feature properties in a new version of a solution.
  • Changing the ID or scope of old Features in a new version of a solution.
  • Removing Feature elements (Element.xml files) in a new version of a solution.
  • Removing Feature properties in a new version of a solution. 
So if any of the above cases apply to you, you should do a retract/delete/add/deploy solution.

2 comments:

Anonymous said...

You said don't use upgradesolution if you are "updating or changing the receiver assembly for existing Features in a new version of a solution". Can you use upgradesolution if you are overwriting receiver assembly as part of the solution deployment? I suspect the answer is yes. BTW, great post.

sprsprspr said...

Yup if you're just overwriting the assembly then no issue. My statement is referring to the case where you want to move a feature into a new solution.