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

12

27

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?

Smote answered 5/12, 2012 at 16:8 Comment(0)
S
45

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.
Smote answered 5/12, 2012 at 16:8 Comment(4)
Running VS as Administrator takes care of the permissions problem. :)Sigfried
I needed to give access to the entire %SystemRoot%\System32\inetsrv\config folder...not just redirection.configWither
Also check your local Documents folder isn't being redirected by OneDrive (see my answer below)Multicellular
problem with me was having 2 documents folder one under user another one under user\OneDrive\documents so make sure you do things on bothFerrosilicon
A
4

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.

Afloat answered 8/4, 2015 at 18:35 Comment(1)
That deployment agent is installed as my user, I'm a domain admin and a local admin and I still can't manage IIS websites or applications.Prasad
M
2

Similar Issue resolved below - Might help

Insufficient Permissions Problems with MSDeploy and TFS Build 2010

Medamedal answered 12/12, 2012 at 12:10 Comment(0)
H
2

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

May work for others.

Hemi answered 18/9, 2013 at 9:58 Comment(0)
F
1

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.

Farmhouse answered 23/10, 2014 at 4:10 Comment(0)
S
1

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.

Saintmihiel answered 30/10, 2015 at 14:22 Comment(0)
C
1

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.

Considerate answered 21/11, 2018 at 19:8 Comment(3)
It actually does work with IIS too, you need to give read permission to IUSR for folder %SystemRoot%\System32\inetsrv\configDom
@AaA, that's really interesting. Did you find any official documentation on the subject?Considerate
Not even one, but I tested it and it is working. Also look at comment under this answerDom
T
0

As this is high in search engines when looking for this error, I'll post my solution.

I used Azure Pipelines to release the app to IIS and had this error. My issue was that I mistakenly used Build Agent job instead of Deployment Group job when configuring the release pipeline.

Tactful answered 27/6, 2022 at 10:14 Comment(0)
C
0

Wow! 10 years ago and still a thing. I am publishing remote. I had to restart the "World Wide Web Publishing Service" and it worked.

Cracker answered 7/6, 2023 at 19:12 Comment(0)
M
0

I had this problem when creating a new Web Project in Visual Studio 2022.

The issue was OneDrive hikacking the user profile and moving "Documents" from

C:\Users\[user]\Documents to C:\Users\[user]\OneDrive\Documents

Once i'd removed OneDrive and changed the documents folder back to its correct location this issue went away

Multicellular answered 21/7, 2023 at 10:30 Comment(1)
I have encountered this error for the first time. I've been using VS 2015, 2017, 2019, and 2022 on this machine for years. I've never encountered this problem, until today. The only thing that's changed is I applied an update, today, to VS 2022. I now have VS 2022 version 17.8.6 installed. Could that be what's causing my problem?Invitation
S
-1

just add your powershell as administrator

Spondaic answered 4/8, 2023 at 7:53 Comment(0)
C
-3

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

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\policies\system

change DWORD "EnableLUA" from 1 to 0

Churchill answered 26/11, 2013 at 20:56 Comment(2)
This should never be the solution because it decrease your security very much.Threshold
A proper system admin knows to keep UAC enabled.Grovergroves

© 2022 - 2024 — McMap. All rights reserved.