Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using MSDeploy for deploy of console application to 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 am already deploying multiple sites to that same server and it works great. I have tried multiple ways but the files are not deployed.

First, I tried to deploy the console app in the same way as i do for my web site, ie:

<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: No error message is returned. It all seems to go well.

Then, I also tried to deploy the console app 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 actually also tried with computername as https://xxx.xxx.xxx.xxx:8172/MsDeploy.axd.

EDIT: The following is what I got. EXEC: FileOrFolderNotFound EXEC: Object of type 'contentPath' and path 'E:\Builds\1...\dev.myapp' cannot be created. EXEC: The path '\?\E:\Builds\1...\dev.myapp' is not valid. EXEC: 1. E:\Builds\1...\BuildType\Targets\Deploy.targets (142): The 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" exited with code -1. I realize I haven't read all of the error, Do I really need an UNC path?

Does anyone know how to do this?

like image 828
Per Avatar asked May 28 '12 07:05

Per


People also ask

Where is MSDeploy exe located?

Go to C:\Windows\System32 and right click on CMD. EXE. Choose “Run as Administrator”. Once the command prompt is up, you will navigate to the folder level where MSDeploy.exe exists.

What is Webdeploy used for?

Overview. The Web Deploy is a tool for simplifying migration, management and deployment of Web applications, sites and servers. It can be used to package a Web site, automatically including content, configuration, certificates and databases. It can be used to synchronize between IIS 6.0, IIS 7.

How do I know if Web Deploy is installed?

Is Web Deploy installed? You can verify web deploy is installed by going to the "Programs and Features" control panel and looking for "Microsoft Web Deploy 2.0" in the list of installed programs. If it is not there, you can install it via the Web Platform Installer by going to the "Products" tab.


1 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 computername to computername=https://xxx.xxx.xxx.xxx:8172/MsDeploy.axd, added authtype=Basic and allowUntrusted=True and voila it worked.

It was quite frustrating not having any kind of feedback of what went wrong with the first option. But when I was using the second alternative I got feedback to work with.

If anyone know how to make this work using the MSBuild task, please feel free to enlighten me.

like image 135
Per Avatar answered Sep 19 '22 10:09

Per