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

I wrote a powershell script that associates a workflow with a site and I want to call it in the post-build event of the workflow project in visual studio.

How do I get the "Site URL" field in the project properties to use as a macro variable in the post-build event?

share|improve this question
up vote 2 down vote accepted

You can use the $(SharePointSiteUrl) variable in the post-build event. $(SharePointSiteUrl)is an extra variable that is available for SharePoint projects.

$(SharePointSiteUrl) is the URL you’ve selected in the properties of the SharePoint project.

$(TargetDir)$(TargetName).wsp is the name of the solution package file.

For flexibility, instead of using hard-coded strings in the Pre-deployment Command Line and Post-deployment Command Line boxes on the SharePoint Properties page, you can use the SharePoint properties as arguments. For example, instead of specifying a specific URL string for the SharePoint site, you can instead use $(SharePointSiteUrl).

Here is the complete list:

share|improve this answer
That was the trick, thanks! – wtjones Dec 28 '12 at 18:36

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.