Recently I came across section registered as allowDefinition='MachineToApplication' beyond application level error while trying to build or rebuild ASP.NET Web application in Visual Studio 2005. I googled a lot..got some suggestions like configure virtual directory in IIS etc..but I was surprised why do I require to do anything in IIS as I was trying to run application in VS 2005 on ASP.NET Development Server.
Finally I got the solution for this. Delete all the backup of current projects which you might have kept in same project. This works.
If you accidentally copy your entire web app into one of its own sub-folders, you will get this error.