views:

860

answers:

3

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.

In my Build Definition I've set the following arguments:

/p:DeployOnBuild=True /p:DeployTarget=MSDeployPublish /p:MSDeployPublishMethod=InProc /p:MsDeployServiceUrl=http://my-server-name:8172/msdeploy.axd /p:EnablePackageProcessLoggingAndAssert=True

However, when I run the build I get the following error, for all three web applications:

Updating setAcl (MyProjectName). 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.)

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.

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.

A couple other things to note:

  1. My build service is running as NETWORK SERVICE.
  2. The server I'm trying to deploy to is on another domain.
  3. I also tried adding /p:username=mydomain\myusername /p:password=mypassword to the MSBuild paramter list, but that didn't help.

Does anyone know if I'm supplying the correct parameters? Or provide me with the correct ones?

Thanks

A: 

Considering vs2010 is RTM'd, you might consider just upgrading and see if the problem goes away.

Chris Lively
I'd like to upgrade to the VS 2010 RTM, but we're in the middle of a project and we're hoping to wait until development is complete to do the upgrade. If it's a bug in the RC we may have to upgrade sooner, but I'd like to verify that I'm using the correct parameters first.
Chad Peck
A: 

For the build that Team Build is running what file did you specify? If it was a solution file then just passing those properties into it doesn't mean that they are then propagated to each project file when built. When you build solution files, only a limited set of properties are passed to the projects being built. If this is the case you should create a .proj file which will essentially replace your solution file and pass in these properties.

I recently blogged about how to Replace your solution file with an MSBuild file.

Let me know if this doesn't apply to you or doesn't help you.

FYI you might also be interested in this other thread on MSDeploy, but its not the same problem your having here. http://stackoverflow.com/questions/2636153/how-can-i-get-tfs2010-to-run-msdeploy-for-me-through-msbuild.

Sayed Ibrahim Hashimi
I am using a solution file, but that didn't appear to be the problem. Just changing MSDeployPublishMethod to RemoteAgent fixed the problem.
Chad Peck
OK, glad to hear you got that squared away.
Sayed Ibrahim Hashimi
+3  A: 

After many rounds of changing the parameters, I was able to find a solution and get the build to deploy successfully. The parameters that I ended up using were:

/p:DeployOnBuild=True /p:DeployTarget=MSDeployPublish /p:MSDeployPublishMethod=RemoteAgent /p:MsDeployServiceUrl=http://my-server-name /p:username=myusername /p:password=mypassword

It appears that when using InProc for the MSDeployPublishMethod MSBuild ignores MsDeployServiceUrl and always tries to deploy to the local server. I changed it to RemoteAgent and it deployed successfully. I did notice that the Package file is nolonger contained in the MyWebApplication_Package folder, but that isn't a big deal to me.

Chad Peck