Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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

1 Answer 1

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

 
discard

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.