It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level

Adam picture Adam · Oct 18, 2010 · Viewed 12.7k times · Source

I want to manage two web.config file in a application one for the front-end user and second for the back-end(admin) user.for admin section I have created a folder with name admin in the same website.following settiongs are in the admin/web.config

when I am trying to run the application I am getting following error message:

It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS

Same problem have discussed on below ASP.NET What causes: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application...?

It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level

Please give me some suggestion to solve this problem. Thanks in advance

Answer

Ananth picture Ananth · Feb 16, 2011

I faced same issue when I had a web application inside another web application resulting in two Web.config files.I deleted one and issue was solved. As configuration settings in the child level can override the ones in parent level,this error can occur when you have 2 web.config files one redefining configuration settings that you cannot override such as authentication or session state. Issue happens when you may have authentication / session state set on the lower level web.config and also in higher level web.config