title: MSDeploy doesn't deploy to remote server using MSBuild and Visual Studio 2010
body: <p>I'm currently running Visual Studio Team System 2010 RC and I'm trying to get the Build Service setup to build my solution and deploy 3 web applications in it.  I've created a custom build configuration called Integration and I've setup the "IIS Web site/application name to use on the destination server" on the Package/Publish tab of the Properties for each of the web applications.</p>
  
  <p>In my Build Definition I've set the following arguments:</p>
  
  <blockquote>
    <p>/p:DeployOnBuild=True /p:DeployTarget=MSDeployPublish /p:MSDeployPublishMethod=InProc /p:MsDeployServiceUrl=<a href="http://my-server-name:8172/msdeploy.axd" rel="noreferrer">http://my-server-name:8172/msdeploy.axd</a> /p:EnablePackageProcessLoggingAndAssert=True</p>
  </blockquote>
  
  <p>However, when I run the build I get the following error, for all three web applications:</p>
  
  <blockquote>
    <p>Updating setAcl (MyProjectName).</p>
    
    <p>C:\Program Files\MSBuild\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.targets(3481,5): error : Web deployment task failed. (Attempted to perform an unauthorized operation.)</p>
  </blockquote>
  
  <p>I don't think this is my actual problem though.  This error is occuring after the following entry in the log:  Updating setAcl
  This is what's causing the error message, but it appears that MSDeploy is trying to deploy to the local IIS on the Build server, not the server I specified with the MsDeployServiceUrl parameter.</p>
  
  <p>After looking at the targets file at C:\Program Files\MSBuild\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.targets, I added the EnablePackageProcessLoggingAndAssert, which adds extra logging.  The log shows an emptry string for the value of MsDeployServiceUrl.  I also noticed in the target that MsDeployServiceUrl has a lowercase s, which is somewhat confusing because the task name MSDeployPublish has an uppercase S.  I tried using it using uppercase, then again using lowercase, but neither worked.</p>
  
  <p>A couple other things to note:</p>
  
  <ol>
  <li>My build service is running as
  NETWORK SERVICE.</li>
  <li>The server I'm
  trying to deploy to is on another
  domain.</li>
  <li>I also tried adding
  /p:username=mydomain\myusername
  /p:password=mypassword to the MSBuild paramter list, but that didn't help.</li>
  </ol>
  
  <p>Does anyone know if I'm supplying the correct parameters? Or provide me with the correct ones?</p>
  
  <p>Thanks</p>