What is this vague error with 'redirection.config' while building a Web Deploy package?

ladenedge picture ladenedge · Dec 5, 2012 · Viewed 44.4k times · Source

I'm trying to build a Web Deploy package via msbuild on a new machine and it's not working. It builds fine on other machines, but here I get the following vague error:

...\Microsoft.Web.Publishing.targets(2767,5): error : Filename: redirection.config
...\Microsoft.Web.Publishing.targets(2767,5): error : Error: Cannot read configuration file
...\Microsoft.Web.Publishing.targets(2767,5): error : 
...\Microsoft.Web.Publishing.targets(2767,5): error : Unknown error (0x80005000)

I'm not sure what 'redirection.config' is, and the line reference to the .targets file doesn't help at all.

How can I fix this?

Answer

ladenedge picture ladenedge · Dec 5, 2012

redirection.config is a file that lives in the IIS configuration directory, typically %SystemRoot%\System32\inetsrv\config. Here are two possibilities:

  1. The account building your project doesn't have access to the IIS config dir. This might happen if you have an automated build identity with special permissions, or you if you need to start Visual Studio as an administrator.
  2. You don't have IIS installed at all on the new machine. Check to be sure the IIS config directory, and redirection.config in particular, even exist. If not, you'll need to install IIS.