Monday, October 16, 2006 - Posts

Overcoming "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."

So it didn't take me too long to fix this but I wanted to document this somewhere to possibly help others and/or myself in the future.  More likely the latter.

I was about to make some rather drastic changes in a website I'm working on.  In order to do so I copied the contents of the entire application to an "archive" folder located under the root.  I didn't just use CVS and/or Subversion because I'm currently in the process of switching between the two (CVS to Subversion).  I then made a bunch of changes and went to build and got this 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."

The problem lies in that the copied web config defines sections that can only be run within an IIS application.  My "archive" folder wasn't set up as such so I was getting a parser error.  In order to fix I simply copied the "archive" folder outside of the root, simple as that.

Hope this benefits someone, even if it's me...again.

with 1 Comments