Using MSDeploy to Deploy a Console Application on a DMZ Server

I am trying to deploy a console application to a folder on a DMZ server using autodeploy with MSBuild and Team Foundation Server.

I already deploy several sites on the same server and it works great. I tried several ways, but the files were not deployed.

Firstly, I tried to deploy the console application in the same way as for my website, that is:

<MSBuild Projects="$(SolutionRoot)\MySolution.sln" Properties="AllowUntrustedCertificate=True;AuthType=Basic; Configuration=DEBUG;CreatePackageOnPublish=True; DeployIisAppPath=Default Website/dummy.dev.myapp; DeployOnBuild=True;DeployTarget=MsDeployPublish; MSDeployPublishMethod=WMSvc; MsDeployServiceUrl=https://xxx.xxx.xxx.xxx:8172/MsDeploy.axd; UserName=userid;Password=password;UseMsdeployExe=True" /> 

Without success.

EDIT: The error message is not returned. Everything seems to be going well.

Then I also tried to deploy the console application as follows:

 <Exec Command="&quot;C:\Program Files\IIS\Microsoft Web Deploy V2\MSDeploy.exe&quot; -verb:sync -source:contentpath=&quot;$(OutDir)\MyApp.Precompiled&quot; -dest:contentpath=&quot;D:\dev.myapp&quot;,computername=xxx.xxx.xxx.xxx,username=userid,password=password" ContinueOnError="false" /> 

I also tried with the name computername as https://xxx.xxx.xxx.xxx:8172/MsDeploy.axd .

EDIT: I got the following. EXEC: FileOrFolderNotFound EXEC: An object of type 'contentPath' and path 'E: \ Builds \ 1 ... \ dev.myapp' cannot be created. EXEC: path "\? \ E: \ Builds \ 1 ... \ dev.myapp" is not valid. EXEC: 1. E: \ Builds \ 1 ... \ BuildType \ Targets \ Deploy.targets (142): command "C: \ Program Files \ IIS \ Microsoft Web Deploy V2 \ MSDeploy.exe" -verb: sync -source : contentpath = "E: \ Builds \ 1 ... \ dev.myapp" -dest: contentpath = "D: \ dev.myapp", computername = https://xxx.xxx.xxx.xxx: 8172 / MsDeploy. axd, username = userid, password = password "came out with the code -1. I understand that I have not read the entire error, do I really need a UNC path?

Does anyone know how to do this?

+6
source share
3 answers

I finally found out how to make it work.

 <Exec Command="&quot;C:\Program Files\IIS\Microsoft Web Deploy V2\MSDeploy.exe&quot; -verb:sync -source:contentpath=&quot;$(OutDir)\MyApp.Precompiled&quot; -dest:contentpath=&quot;D:\dev.myapp&quot;,computername=https://xxx.xxx.xxx.xxx:8172/MsDeploy.axd,username=userid,password=password,authtype=Basic -allowUntrusted=True" ContinueOnError="false" /> 

I changed computer_name to computername = https://xxx.xxx.xxx.xxx: 8172 / MsDeploy.axd , added authtype = Basic and allowUntrusted = True and voila. It worked.

It was rather frustrating not to have any feedback on what went wrong with the first option. But when I used the second alternative, I got feedback for the job.

If anyone knows how to do this work using the MSBuild task, please feel free to educate me.

+7
source

Try the dirPath provider instead of contentPath, it will behave more like folder synchronization, rather than deploying an IIS website.

+3
source

Given the synchronization performed using the EXEC task, did you make sure that the csproj (or vbproj) file contains Microsoft.WebApplication.targets ? I could see that it simply ignores this msbuild task without the correct target file.

For example, in web service project files, I have this at the bottom of my csproj file

 <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" /> 
+1
source

Source: https://habr.com/ru/post/916821/


All Articles