Unrecognized argument 'True'. All arguments must begin with "-" (msdeploy.exe)

Posted on
msdeploy WebDeploy

Are you trying to deploy your application using msdeploy.exe with argument AllowUntrusted set to True and this error occur? Unrecognized argument ‘True’. All arguments must begin with “-”.

[08:57:58][Step 1/1] Executing: ../WebDeployPackage/ProjectName.deploy.cmd /Y /M:https://10.10.70.69:8172/MSDeploy.axd /U:srv_Teamcity -AllowUntrusted=True
[08:57:59][Step 1/1] SetParameters from:
[08:57:59][Step 1/1] "D:\BuildAgent\work\57910644296a4e40\WebDeployPackage\ProjectName.SetParameters.xml"
[08:57:59][Step 1/1] You can change IIS Application Name, Physical path, connectionString
[08:57:59][Step 1/1] or other deploy parameters in the above file.
[08:57:59][Step 1/1] -------------------------------------------------------
[08:57:59][Step 1/1]  Start executing msdeploy.exe
[08:57:59][Step 1/1] -------------------------------------------------------
[08:57:59][Step 1/1]  "C:\Program Files\IIS\Microsoft Web Deploy V3\msdeploy.exe" -source:package='D:\BuildAgent\work\57910644296a4e40\WebDeployPackage\ProjectName.zip' -dest:auto,computerName="https://10.10.70.69:8172/MSDeploy.axd",userName="srv_Teamcity",includeAcls="False" -verb:sync -disableLink:AppPoolExtension -disableLink:ContentExtension -disableLink:CertificateExtension -setParamFile:"D:\BuildAgent\work\57910644296a4e40\WebDeployPackage\ProjectName.SetParameters.xml"  -AllowUntrusted True
[08:57:59][Step 1/1] Error: Unrecognized argument 'True'. All arguments must begin with "-".
[08:57:59][Step 1/1] Error count: 1.

How to solve it?

Change the

-AllowUntrusted=True

to

-AllowUntrusted:True

for example:

ProjectName.deploy.cmd /t /m:DestinationServerName /u:User /p:Password /a:basic -AllowUntrusted:True