Web Deploy - Using Relative Paths for local file system deployment

Viewed 11476

I am wanting to use Web Deploy to run a custom deployment setup.

As I am wanting to have this work fine when running on many different environments (team members local machines, 4 different builds servers) I want to deploy to a local path that is relative.

What I am wanting to do is:

  • Deploy to a local relative path
  • Have the after build step do magical things...

However when i enter the local file path to deploy to as: "..\Deploy_Production"

web deploy complains with this:

2>Connecting to ..\Deploy_Live...
2>Unable to create the Web site '../Deploy_Live'.  The URL http://:0 is invalid.

Its as if Web deploy thinks that the relative file path is a website URL. Using "..\" instead doesn't help my cause.

How do you get WebDeploy to deploy to a local relative path?

Edit 1:

I have tried to use a ConvertToAbsolutePath task before build, to no avail:

  <PropertyGroup>
    <WebPublishMethod>FileSystem</WebPublishMethod>
    <SiteUrlToLaunchAfterPublish>http://mywebsite.com</SiteUrlToLaunchAfterPublish>
    <publishUrl>..\Deploy_Production</publishUrl>
    <DeleteExistingFiles>False</DeleteExistingFiles>
  </PropertyGroup>

  <Target Name="BeforeBuild">
    <ConvertToAbsolutePath Paths="$(publishUrl)">
      <Output TaskParameter="AbsolutePaths" PropertyName="publishUrl" />
    </ConvertToAbsolutePath>
  </Target>

Edit 2: The above works, but only when running commandline builds against the Solution file not a project file

1 Answers
Related