Tuesday, May 18, 2010

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

Error: "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"

This error really drived me crazy. Just can't figure out what exactly went wrong. When I double clicked on this error message it took me to web.config and pointed the line "<authentication mode="Windows"/>. What's wrong in that? the syntax is all correct.

Later I found that I have created an application inside the root application and all it was like a folder(root application) and subfolder(my second application). What was happening in the background was the authentication which was already defined in the root applications web.config file was not ready to be overridden in my second applications web.config and that was the problem.

Later I moved out my second application and placed like a root folder and it solved my problem.

3 comments:

Mathi Rajan said...
This comment has been removed by the author.
Mathi Rajan said...

You could alternatively fix it by changing the folder to Application. Thats exactly what the error message is telling you.

Goto properties of the folder, navigate to Directory\Application settings and click on Create button.

Mathi

Nivas Dharuman said...

@Mathi: You say to create an application in IIS right? I tried that too but that didn't worked out.