MSBuild.ExtensionPack.Web.Iis7Website error: COMException: Invalid index

0

What can be the cause of the error when creating a web site via TeamCity, using MSBuild.ExtensionPack?

[MSBuild.ExtensionPack.Web.Iis7Website]: COMException: Invalid index. (Exception from HRESULT: 0x80070585)

TeamCity client machine:

  • Windows Server 2012 R2
  • IIS 8.5.9600.16384
  • TeamCity version: 8.1.5 (build 30240)

Web server machine:

  • Windows Server 2008 R2
  • IIS version: 7.5.7600.16385

A previous task that deletes the current web site works OK. it is the Create task that fails:

<MSBuild.ExtensionPack.Web.Iis7Website TaskAction="Create" 
 MachineName="$(web-server)" 
 Name="$(web-name)" 
 Path="$(web-deploy-dir-local)" 
 AppPool="$(web-name)" 
 WindowsAuthentication="true" 
 Port="$(site-port)">

Also, the Create task works OK when run via another TeamCity Client on another machine.

Thanks.

iis
msbuild
teamcity
asked on Stack Overflow Nov 27, 2014 by stasde • edited Nov 27, 2014 by stasde

1 Answer

0

I had the same exact problem, I fixed it doing this.

  1. Create a user with the same name in both machines (i.e. build).
  2. Add the user to the Administrators group in both machines.
  3. Change the TeamCity service to execute it using the new user credentials.
  4. Restart TeamCity service.
  5. Try to execute your build again.

I hope this helps.

answered on Stack Overflow Nov 27, 2014 by Rolo

User contributions licensed under CC BY-SA 3.0