I am trying to run the ProjectName.deply.cmd that is generated by MSBuild when the paramter /p:DeployOnBuild=True
is passed. One of the argument "ComputerName" is to be passed as https://WebServer01:8172/MSDeploy.axd?SiteName=MySiteName
. My command line would be
ProjectName.deploy.cmd /Y /M:https://WebServer01:8172/MSDeploy.axd?Site=MySiteName
-AllowUntrusted /U:DeployUserName /P:Password /A:Basic
It returns
Error: Unrecognized argument 'MySiteName'. All arguments must begin with "-".
the actual command that is executed is
"C:\Program Files\IIS\Microsoft Web Deploy V3\\msdeploy.exe"
-source:package='Y:\ProjectName.zip'
-dest:auto,computerName='https://WebServer01:8172/MSDeploy.axd?Site',userName='DeployUserName',password='Password',authtype='Basic',includeAcls='False'
-verb:sync -disableLink:AppPoolExtension -disableLink:ContentExtension
-disableLink:CertificateExtension
-setParamFile:"Y:\ProjectName.SetParameters.xml"
MySiteName
-AllowUntrusted
Notice that the argument to /M https://WebServer01:8172/MSDeploy.axd?Site=MySiteName
is split into two arguments and thus creating computerName='https://WebServer01:8172/MSDeploy.axd?Site'
and and extra argument MySiteName
.
I have gone through Running a deployment package with quoted parameters fails in Visual Studio 2010 Service Pack 1 but that takes care of only ArgMsDeployAdditionalFlags
and not the arguments e.g. /M:ComputerName
.
When the SiteName is not passed, I can do the deployment fine with an user that had admin rights on the server but when a standard IIS user DeployUserName is used I get 401
ProjectName.deploy.cmd /Y /M:https://WebServer01:8172/MSDeploy.axd
-AllowUntrusted /U:DeployUserName /P:Password /A:Basic
The server returns 401
Error Code: ERROR_USER_UNAUTHORIZED
More Information: Connected to the remote computer ("WebServer01") using the Web
Management Service, but could not authorize. Make sure that you are using the
correct user name and password, that the site you are connecting to exists, and
that the credentials represent a user who has permissions to access the site.
Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_USER_UNAUTHORIZED.
Error: The remote server returned an error: (401) Unauthorized.
The permissions for that user are fine as the publish from VS2012
with MSDeploy
profile using that user works just fine. I can also build msdeploy.exe
command and that also runs fine. I have to use the ProjectName.deploy.cmd
as it is being produced as part of Team Build
from TFS2010
.
Have you tried quoting the argument?
ProjectName.deploy.cmd /Y "/M:https://WebServer01:8172/MSDeploy.axd?Site=MySiteName"
-AllowUntrusted /U:DeployUserName /P:Password /A:Basic
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With