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.