Error: cannot access redirection.config when using Microsoft.Web.Administration assembly

3k views Asked by At

I am using the IIS 7 assembly Microsoft.Web.Administration to read and modify the MIME types for an ASP.NET site, and this works fine on Windows 2003 and 7, however on Windows Server 2012 (64 bit) I get the error "Filename: redirection.config Error:cannot read configuration file due to insufficent permissions".

This application is installed on multiple client sites where modifying the permissions on the system32 folder is not an option, and neither is disabling UAC. The application requires Windows Authentication, so switching to Basic Authentication is not an option. I have tried running the app pool as Network Service, Local System, ApplicationPoolIdentity and a domain account but get the same error.

I'm not sure why ASP.NET requires access to reditrection.config in order to access the functionality in the Microsoft.Web.Administration assembly.

Is it even possible to use Microsoft.Web.Administration on a 2012 Server with UAC enabled without having to modify system folder permissions or disabling UAC? or am I wrong in using Microsoft.Web.Administration for this function?

3

There are 3 answers

2
George Paoli On BEST ANSWER

I had the same problem. The only solution was to give permission in "C:\Windows\System32\inetsrv\config" for user IIS_IUSRS. I could not solve otherwise.

Hope this helps.

0
John Mills On

Either:

  1. Assign Local System or a local administrator account as the application pool identity

    Or

  2. Grant the application pool identity, read permissions to the C:\Windows\System32\inetsrv\config folder.

Granting read permissions to redirection.config as implied by the error message is not sufficient to get it to work.

0
Lex Li On
  1. Your web application using MWA must be running in a 64 bit application pool. I don't think you can run it in a 32 bit pool.
  2. The pool identity must be Local System, or another local administrator account. So you have to build other protection around your web app.