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

48,209

Solution 1

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.

Solution 2

If you receive this error when deploying with Release Managment (via IISConfig.exe) be sure that the deployment agent service account is in the local Administrators group. You may need to restart the deployment agent service.

Solution 3

For me, simply running visual studio as admin gave it the elevated permissions it needed to operate against this folder.

May work for others.

Solution 4

Similar Issue resolved below - Might help

Insufficient Permissions Problems with MSDeploy and TFS Build 2010

Solution 5

This error just appeared to me when my C# project was referencing the Microsoft.Web.Administration, Version=7.9.0.0 assembly. It looks like this assembly only works with IIS Express. For IIS, we must use Microsoft.Web.Administration, Version=7.0.0.0.

Share:
48,209
ladenedge
Author by

ladenedge

Updated on November 22, 2020

Comments

  • ladenedge
    ladenedge over 3 years

    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?

  • Mike Kruger
    Mike Kruger almost 10 years
    Running VS as Administrator takes care of the permissions problem. :)
  • Max
    Max about 8 years
    This should never be the solution because it decrease your security very much.
  • nthpixel
    nthpixel about 7 years
    I needed to give access to the entire %SystemRoot%\System32\inetsrv\config folder...not just redirection.config
  • AaA
    AaA over 5 years
    It actually does work with IIS too, you need to give read permission to IUSR for folder %SystemRoot%\System32\inetsrv\config
  • Vinicius
    Vinicius over 5 years
    @AaA, that's really interesting. Did you find any official documentation on the subject?
  • AaA
    AaA over 5 years
    Not even one, but I tested it and it is working. Also look at comment under this answer
  • Reacher Gilt
    Reacher Gilt over 5 years
    A proper system admin knows to keep UAC enabled.