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


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?

asked on Stack Overflow Dec 5, 2012 by ladenedge

8 Answers


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.
answered on Stack Overflow Dec 5, 2012 by ladenedge • edited Dec 22, 2014 by ladenedge

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.

answered on Stack Overflow Apr 8, 2015 by Timothy Schoonover

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

May work for others.

answered on Stack Overflow Sep 18, 2013 by Adam Naylor

I got this error when I tried to use a relative path for the contentPath setting. I fixed it by settings the contentPath to the full path of the folder. Without the full path, the contentPath provider thinks it is a site path or application path and looks for it in in the IIS configuration.

answered on Stack Overflow Oct 23, 2014 by Cameron Taggart

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

answered on Stack Overflow Nov 21, 2018 by Vinicius

After hours of testing and troubleshooting this problem turned out to be an issue with the users profile.

This was found by logging in as myself and I didn't receive the same issue.

To fix this issue:

  1. Log into the machine as an administrator and delete the contents of the corrupt profile from C:\Users (or rename the folder to username.OLD)
  2. Open up the registry and navigate here – HKLM\SOFTWARE\Microsoft\Windows NT\ CurrentVersion\ProfileList
  3. Find the corrupt profile and rename this to .OLD or remove it.

You can read more about it at this article.

answered on Stack Overflow Oct 30, 2015 by John • edited Jun 20, 2020 by Community

On server 2012 this error can be caused by UAC which needs to be disabled via the registry.

This article explains why... https://social.technet.microsoft.com/wiki/contents/articles/13953.windows-server-2012-deactivating-uac.aspx


change DWORD "EnableLUA" from 1 to 0

answered on Stack Overflow Nov 26, 2013 by Dean North

User contributions licensed under CC BY-SA 3.0