SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

When building my SharePoint projects with Visual Studio 2010, I prefer to use Package instead of Deploy. Even if I plan to deploy the wsp on my computer, I want to use my PowerShell scripts in order to test the deployment process for when I eventually deploy to a server that does not have Visual Studio.

If I go to the project properties page, I can add commands to either Build Events > Post-event command line or SharePoint > Pre-deployment Command Line. The former is too early because the solution package hasn't been built. The latter might work, but is there a way to quietly exit or cancel the deployment without receiving a "Build failed" error? If not, is there a way to edit the csproj file so that I can run a post-package command?

share|improve this question
up vote 3 down vote accepted

Have you tried creating a new deployment configuration on the SharePoint tab with Run Pre-Deployment Command as the only step and then putting your post-package command(s) in the Pre-deployment command line box?

...and make sure that you set Active Deployment Configuration to your newly created deployment configuration.

share|improve this answer
Perfect! I totally overlooked that section. That's exactly what I wanted. Thanks! – Rich Bennema Jul 25 '11 at 15:17

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.