I want to use Web Deploy to run a custom deployment installation.
Since I want this work to be great when working in many different environments (local teams of group members, 4 different build servers), I want to deploy a local path that is relative.
What I want to do is:
- Expand the local relative path
- After the build is complete, do magical things ...
However, when I enter the local file path for deployment as: ".. \ Deploy_Production"
web deployment complains about this:
2>Connecting to ..\Deploy_Live... 2>Unable to create the Web site '../Deploy_Live'. The URL http://:0 is invalid.
As if the web deployment considers the relative path to the file to be the URL of the website. Using ".." instead does not help my reason.
How to get WebDeploy to deploy a local relative path?
Change 1:
I tried using the ConvertToAbsolutePath task before building, 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 you run the command line for the solution file is not a project file
msbuild webdeploy msdeploy
Doug Aug 19 2018-12-12T00: 00Z
source share