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

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
add comment

1 Answer

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

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

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.