7

I've just switched to using IIS7 in my Visual Studio 2010 project. I've run VS 2010 as an administrator to do so.

When I navigate to the URL for my page on the IIS server I get this message:

"The requested page cannot be accessed because the related configuration data for the page is invalid."



In the detailed error information it has this:

Module: IIS Web Core
Notification: BeginRequest
Handler: Not yet determined
Error Code: 0x80070021
Config Error: This configuration section cannot be used at this path. This happens when the section is locked at a parent level. Locking is either by default (overrideModeDefault="Deny"), or set explicitly by a location tag with overrideMode="Deny" or the legacy allowOverride="false".
Config File: \?\C:\Users\Chris Paynter\Documents\Visual Studio 2010\Projects\TypeTest\TypeTest\web.config

Then in the config source it shows line 48 in red:

47:   <validation validateIntegratedModeConfiguration="false"/>
48:   <modules runAllManagedModulesForAllRequests="true"/>
49:   </system.webServer>

I'm very new to ASP.NET and it would be much appreciated if anyone can guide me in the right direction to resolving this.

Cheers

Chris
  • 7,996
  • 11
  • 66
  • 98
  • Hi Chris, i've been there man !! i will be with you step by step till every thing is OK. First i need to know if you are working on a machine with some sort of security agent or you dont have admin previliges. second, did you try to put your app folder in WWWROOT folder and set proper permissions? any way you may clarify more and hopefully i will be able to help – Mohamed Kamal Dec 07 '10 at 14:19
  • Sorry about the delayed reply, I didn't receive a notification of your comment! I have full admin privileges and there are no security agents installed other than default Win 7 software. I have not placed my app folder in WWWROOT, is this a requirement in order to run on IIS? Which folder actually is the app folder? Thanks so much for your comment back! – Chris Dec 14 '10 at 01:53
  • Chris, is this issue still open? I'd like to see the entire web.config, and I'd also be interested in any tweaks you may have made in IIS. – Brian Webster May 08 '11 at 06:02
  • Yes certainly is, I am a bit under the pump at the moment, but will get back to you asap. Thanks so much for the interest in solving it, it's one of the questions I keep seeing in my dashboard that I wished was resolved. Speak soon! – Chris May 08 '11 at 06:44
  • possible duplicate of: http://stackoverflow.com/questions/9794985/iis-this-configuration-section-cannot-be-used-at-this-path-configuration-lock – RandomUs1r Mar 11 '13 at 16:58

2 Answers2

2

With command prompt launched as Admnistrator, go to :

C:\Windows\Microsoft.NET\Framework64\v4.0.30319>

execute

aspnet_regiis -i
p.s.w.g
  • 146,324
  • 30
  • 291
  • 331
Firoze Rakib
  • 132
  • 1
  • 4
0

Sounds like the application pool the website is running is not configured correctly. You're probably using the wrong Managed Pipeline Mode.

In IIS7 manager find the Application Pool your web site is using (To check the app-pool click the website in the tree, then click "Basic settings" in the right pane, the Application pool name is then shown in the dialog). If you click the "Application pools" item in the tree to the left you will see a list of Application Pools in the middle. Your application pool should probably be running in "Classic Managed Pipeline Mode" if it has been ported directly to IIS7 from an IIS6 server.

To change the Pipeline mode, select the App-pool in the list then click "Basic Settings" to the right, the dialog shown also lets you select the .NET framework version used when running the site.

You can read more about pipeline modes on MSDN

Regards Jesper Hauge

Hauge
  • 1,709
  • 15
  • 25
  • On that same note it could even be that the App pool is set for a different version of .NET Framework than the web.config is thinking it is. I've had that happen before where it was a 4.0 site and the App pool was still set to 2.0 – ashelvey May 23 '11 at 20:37