I experienced the error shortly after configuring and using the Publishing Wizard in Visual Studio 2012:
Error 20 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.
Note that many users have experienced this in both VS2010 and VS2012. It is terribly inconvenient to work around the issue because it sometimes requires the `bin` and `obj` folders to be manually deleted *for every single compile* once the bug begins to manifest. Even if that were automated as a build task (for every project...), that greatly increases compile time for large solutions.
Coverage on StackOverflow: