3

I have set up a Continuous Integration build with TeamCity and MSBuild. I am using the MSBuild Extension Pack, primarily for its IIS7AppPool Task. My goal is to stop an IIS app pool before the build script does a deployment step and start the app pool afterwards. The IIS app pool is on a different server from the build agent.

I have used the following MS Build code to stop IIS:

<MSBuild.ExtensionPack.Web.Iis7AppPool TaskAction="Stop" MachineName="$(DeploymentServerName)" Name="$(WebAppPoolName)" Username="$(DeploymentServerUsername)" UserPassword="$(DeploymentServerUserPassword)" />

I have set up a local admin user account on the web server, and used its username and password above as $(DeploymentServerUsername) and $(DeploymentServerPassword).

The error I am receiving is:

[MSBuild.ExtensionPack.Web.Iis7AppPool] E:\TeamCity\BuildAgent\work\1a1dc058c29f0f12\BuildAndDeployment\Build_DevCI.proj(153, 5): UnauthorizedAccessException: Retrieving the COM class factory for remote component with CLSID {2B72133B-3F5B-4602-8952-803546CE3344} from machine DEPLOYMENTSERVERMACHINENAME failed due to the following error: 80070005 DEPLOYMENTSERVERMACHINENAME.

I have asked our network guys to take down any firewalls between the two machines, but I still get the same error.

Can anyone see anything wrong with my syntax or offer any advice on how to get this to work?

I can get the task to stop an IIS app pool on my local machine ok, so my syntax should be right.

I have looked at this post, but I don't think it's the same problem:

MSBuild remoting to server throws COMException error

Community
  • 1
  • 1
Paul Houghton
  • 491
  • 3
  • 9
  • I never managed to resolve this issue. We do have extremely stringent network policies here run by people who often don't understand what they're doing though. Here's what I tried: MSBuild.Community.Tasks and MSBuild Extension Pack - both threw the above exception. Powershell 2.0 - needed to manually enter password each time. PSTools PSExec - worked when I ran it directly from the command line, but not when launched from the build agent [link](http://forum.sysinternals.com/psexec-exits-with-rc6-when-started-thro-iis-java_topic23486.html). I finally made a webservice that can manage app pools. – Paul Houghton Jul 16 '12 at 11:09
  • I've run into the same error and the error changed to a warning (and then an error) when I started using a different interface to connect to the server. Can it be that IIS management DCOM only listens to one interface? – Isaac Llopis Jun 02 '15 at 10:56

0 Answers0