Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 918
Shane Avatar asked Apr 01 '26 18:04

Shane


2 Answers

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.

like image 151
George Paoli Avatar answered Apr 04 '26 08:04

George Paoli


  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.
like image 30
Lex Li Avatar answered Apr 04 '26 08:04

Lex Li