What is this vague error with 'redirection.config' while building a Web Deploy package?
Solution 1
redirection.config is a file that lives in the IIS configuration directory, typically %SystemRoot%\System32\inetsrv\config
. Here are two possibilities:
- 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.
- 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
.
ladenedge
Updated on November 22, 2020Comments
-
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 almost 10 yearsRunning VS as Administrator takes care of the permissions problem. :)
-
Max about 8 yearsThis should never be the solution because it decrease your security very much.
-
nthpixel about 7 yearsI needed to give access to the entire
%SystemRoot%\System32\inetsrv\config
folder...not just redirection.config -
AaA over 5 yearsIt actually does work with IIS too, you need to give read permission to IUSR for folder %SystemRoot%\System32\inetsrv\config
-
Vinicius over 5 years@AaA, that's really interesting. Did you find any official documentation on the subject?
-
AaA over 5 yearsNot even one, but I tested it and it is working. Also look at comment under this answer
-
Reacher Gilt over 5 yearsA proper system admin knows to keep UAC enabled.