Tuesday, July 21, 2009

ASP.NET website "Cannot read configuration file due to insufficient permissions" in IIS 7 and Windows Server 2008

"The server is configured to use pass-through authentication with a built-in account to access the specified physical path. However, IIS Manager cannot verify whether the built-in account has access. Make sure that the application pool identity has Read access to the physical path. If this server is joined to a domain, and the application pool identity is NetworkService or LocalSystem, verify that \$ has Read access to the physical path. Then test these settings again."

"Cannot read configuration file due to insufficient permissions"


Solution:
1. Add IIS_IUSRS with Read permission on files in the folder
2. Change IIS authentication method to BasicAuthentication
3. refresh the website. It will work

7 comments:

Matthew Lock said...

I couldn't get this working until I gave read permissions to Network Service and Everybody

Unknown said...

Another possible cause: If you restored from a backup or zip, make sure the files are not encrypted (usually indicated by a green highlight).

Dattatray Pawar said...

Thanks
it works

Ashish Yadav said...

Thanks.
It worked on windows 7 have to set Annoymous Authentication->Edit->Application Pool Identity

Unknown said...

Can u plz elaborate on the 1st point.

1.Add IIS_IUSRS with Read permission on files in the folder.


I'm pretty new to this.

Thanks in Advance.

Unknown said...

@Adil: Check out the link: http://stackoverflow.com/questions/5615296/cannot-read-configuration-file-due-to-insufficient-permissions for answers to this question .

MohanP said...

Solution worked like a charm. Thank you so much.

ASP.NET MVC - Sport Facility Booking system

  The project relies on some external service providers. Thus accessing them via their API requires authentication. An API Key need to be su...