2006-07-28

ASP.NET: allowDefinition= 'MachineToApplication' / Web.Config

I was working on an ASP.NET application when I started getting the following message while building:

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.     web.config     28

I tried a few things out, and examined the referenced web.config line, but nothing seemed out of the ordinary.

It took me a few minutes to figure out that I was looking at the wrong web.config. I had made a backup copy of the project (no SCCS yet - don't ask) in a subfolder. The web.config referenced in the error message was the backup copy, not the one belonging to the application I was working on. Removing the subfolder / project backup got rid of the message.

»

1 comment:

Elizabeth said...

Just wanted to say "Thanks!" for explaining what was needed in such plain terms. I'm such a noob at web development (learning as I go -- self teaching kind of thing) and nowhere have I found such a simple explanation. And of course, it was right on target.

Thanks!