MSBuild Extension Pack IIS7 task on remote server error

1.7k Views Asked by At

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

0

There are 0 best solutions below