Deployment works fine in Visual Studio, cannot use MSDeploy

I have a web project, and I would like to deploy it using MSDeploy to the staging environment.

From Visual Studio, publishing everything works fine with these settings: Server: mystaging.com

  • Site Name: project-staging(I deleted the default website, and this is the only site in my intermediate IIS)
  • Username: Administrator
  • Password: SomePasswordHere
  • Destination: mystaging.com

(mystaging.com is a public site - obviously not this one)

Deployment works great with Visual Studio.

Trying the same from MSDeploy:

-verb:sync 
-allowUntrusted
-source:contentPath="C:\Users\...\obj\Staging\Package\PackageTmp" 
-dest:contentpath='C:\inetpub\wwwroot\project-staging'
    includeAcls='False',
    ,ComputerName=https://mystaging.com:8172/msdeploy.axd?site=project-staging
    ,UserName=Administrator
    ,Password=SomePasswordHere
    ,AuthType=Basic

failure:

Error Code: ERROR_USER_UNAUTHORIZED
More Information: Connected to the remote computer ("mystaging.com") 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.
Error count: 1.
Process exited with code -1

I tried everything (elevating access rights, creating other users, etc.) and nothing worked.

- , , , MSDeploy?

+4
2

, -? , , .

: ​​

+1

contentPath ZIP msbuild msdeploy .

"C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe"
           MyWebApp/MyWebApp/MyWebApp.csproj
           /T:Package
           /P:Configuration=Debug;PackageLocation="C:\Build\MyWebApp.Debug.zip";DeployIisAppPath=project-staging

:

"C:\Program Files\IIS\Microsoft Web Deploy V2\msdeploy.exe" -verb:sync
     -source:package="C:\Build\MyWebApp.Debug.zip"
     -dest:auto,wmsvc=devserver,username=deployuser,password=*******
     -allowUntrusted=true

. - -. ZIP . (. , ).

0

All Articles