Joe Levi:
a cross-discipline, multi-dimensional problem solver who thinks outside the box – but within reality™

ASP.NET Error: It is an error to use a section … beyond application level

Today while trying to run a web application that a couple other developers and I are working on, I got the following error when trying to run the application. This error then pointed me to my web.config file.

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

After some digging and talking with another developer, turns out he’d made the Web Site into a full-blown Solution, but I was still trying to open it as a web site. As soon as I opened it up as a Solution (by opening the .sln file) the project built and ran just fine.

Hope it helps, if not, here are some other possible reasons:

Share

You may also like...

6 Responses

  1. semi max says:

    Hi, i am also getting 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

    i convert my 1.1 application in 2.0 wen i m trying to build the solution it shows this error.. i didn’t took the backup from converting wizard. because i copied 1.1 App in some other place then i convert it.. i read some solutions they said this is due to backup folder but i dont have any backup folder..
    Please help if u can….

  2. Joe says:

    Another possible source of this is if (for some odd reason) you have a duplicate web.config file (that’s in a different folder in the same project).

    We ran into this problem when we somehow got a copy of our working files/folders nested inside the root folder of our project. Removing the duplicate web.config fixed the problem (and we removed the rest of the nested files/folders after that).

    Thanks to http://www.MikeDopp.net for finding this out!

    http://www.JoeLevi.com

  3. taraka ravi says:

    Thank you. This post helped me in solving my problem. As soon as I opened my web site as a Solution (by opening the .sln file) the project built and ran just fine.

  4. Joe says:

    @Taraka Ravi:

    Glad to be able to help!

    http://www.JoeLevi.com

  5. Bino says:

    can u pls be bit more specific.i’ve 5 folders,i mean 5 application folders,that are published.but im getting this error when i set this as a virtual directory.there are different web.config in each folders having different local settings.pls help

    http://www.codepal.co.in

  6. Selva says:

    Thanks Joe, its helped.

Leave a Reply