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?

1 Answer 1


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: http://msdn.microsoft.com/en-us/library/ee696754%28VS.100%29.aspx


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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