Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4558622
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T17:40:28+00:00 2026-05-21T17:40:28+00:00

There is an excellent PDC talk available here from Vishal Joshi which describes the

  • 0

There is an excellent PDC talk available here from Vishal Joshi which describes the new MSDEPLOY features in Visual Studio 2010 – as well as how to deploy an application within TFS. (There’s also a great talk from Scott Hanselman but he doesn’t go into TFS).

You can use MSBUILD within TFS2010 to call through to MSDEPLOY to deploy your package to IIS. This is done by means of parameters to MSBUILD.

The talk explains some of the command line parameters such as :

/p:DeployOnBuild
/p:DeployTarget=MsDeployPublish
/p:CreatePackageOnPublish=True
/p:MSDeployPublishMethod=InProc
/p:MSDeployServiceURL=localhost
/p:DeployIISAppPath="Default Web Site"

But where is the documentation for this – I can’t find any?

I’ve been spending all day trying to get this to work and can’t quite get it right and keep ending up with various errors. If I run the package’s cmd file it deploys perfectly. If I run WebDeploy through Visual Studio it also works perfectly.

But I want to get the whole deployment running through msbuild using these arguments and not a separate call to msdeploy or running the package .cmd file. How can I do this?

PS. Yes I do have the Web Deployment Agent Service running. I also have the management service running under IIS. I’ve tried using both.


Args I’m using :

/p:DeployOnBuild=True 
/p:DeployTarget=MsDeployPublish 
/p:Configuration=Release 
/p:CreatePackageOnPublish=True  
/p:DeployIisAppPath=staging.example.com   
/p:MsDeployServiceUrl=https://staging.example.com:8172/msdeploy.axd 
/p:AllowUntrustedCertificate=True

giving me :

C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.targets (2660): VsMsdeploy failed.(Remote agent (URL https://staging.example.com:8172/msdeploy.axd?site=staging.example.com) could not be contacted. Make sure the remote agent service is installed and started on the target computer.) Error detail: Remote agent (URL https://staging.example.com:8172/msdeploy.axd?site=staging.example.com) could not be contacted. Make sure the remote agent service is installed and started on the target computer. An unsupported response was received. The response header ‘MSDeploy.Response’ was ” but ‘v1’ was expected. The remote server returned an error: (401) Unauthorized.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T17:40:29+00:00Added an answer on May 21, 2026 at 5:40 pm

    IIS7 + related answer ….

    Ok – here’s what I ended up doing. More or less, following the post by Simon Weaver in this thread/question.

    But when it comes to the MSBuild settings .. most people here are using following setting: /p:MSDeployPublishMethod=RemoteAgent which is NOT RIGHT for IIS7. Using this setting means TFS tries to connect to the url: https://your-server-name/MSDEPLOYAGENTSERVICE But to access that url, the user to authenticate needs to be an Admin. Which is fraked. (And you need to have the Admin-override rule thingy ticked). This url is for IIS6 I think.

    Here’s the standard error message when you try to connect using RemoteAgent :-

    Standard 401 Frak Off u suck RemoteAgent, error

    C:\Program Files
    (x86)\MSBuild\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.targets
    (3588): Web deployment task
    failed.(Remote agent (URL
    http://your-web-server/MSDEPLOYAGENTSERVICE)
    could not be contacted. Make sure the
    remote agent service is installed and
    started on the target computer.) Make
    sure the site name, user name, and
    password are correct. If the issue is
    not resolved, please contact your
    local or server administrator. Error
    details: Remote agent (URL
    http://your-web-server/MSDEPLOYAGENTSERVICE)
    could not be contacted. Make sure the
    remote agent service is installed and
    started on the target computer. An
    unsupported response was received. The
    response header ‘MSDeploy.Response’
    was ‘V1’ but ‘v1’ was expected. The
    remote server returned an error: (401)
    Unauthorized.

    So .. you need to change your MSDeployPublishMethod to this:

    /p:MSDeployPublishMethod=WMSVC
    

    The WMSVC stands for Windows Manager Service. It’s basically a newer wrapper over the Remote Agent but now allows us to correct provide a user name and password .. where the user does NOT have to be an admin! (joy!) So now you can correct set which users u want to have access to .. per WebSite ..

    enter image description here

    It also now tries to hit the the url: https://your-web-server:8172/MsDeploy.axd <– which is EXACTLY what the Visual Studio 2010 Publish window does! (OMG -> PENNY DROPS!! BOOM!)

    enter image description here

    And here’s my final MSBuild settings:

    /p:DeployOnBuild=True
    /p:DeployTarget=MSDeployPublish 
    /p:MSDeployPublishMethod=WMSVC
    /p:MsDeployServiceUrl=your-server-name
    /p:DeployIISAppPath=name-of-the-website-in-iis7    
    /p:username=AppianMedia\some-domain-user 
    /p:password=JonSkeet<3<3<3
    /p:AllowUntrustedCertificate=True
    

    Notice the username has the domain name in it? Ya need that, there. Also, in my picture, I’ve allowed our DOMAIN USERS access to the website for managament. As such, my new user account i added (TFSBuildService) has Membership to the Domain Users group … so that’s how it all works.

    Now – if u’ve read all this, have a lolcat (cause they are SOOOOOOOO 2007)….

    enter image description here

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

There is a directed graph having a single designated node called root from which
There are two intents on the receiver side which are called from the same
I was reading this excellent article which gives an introduction to Asynchronous programming here
In html5 there is the excellent <date> which works on Opera (and partially on
There is an excellent code example on how to make nice jQuery Twitter style
There's already excellent code for browsing and viewing pictures on the iPhone, as shown
Is there something similar to C#'s excellent Parallel.For in Python? I just want to
TTR has some excellent TA indicators. Is there a package or function that calculates
There's a Rails 3.2.3 web application which doesn't use any database. But in spite
I have just implemented the excellent jQuery UI autocomplete. http://jqueryui.com/demos/autocomplete/ There is a strange

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.