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.

1. Create a Virtual Directory and add your application to it.(Give the physical path of the project, then it will load in virtual directory)

2. After the virtual directory is created and your project is loaded into it, right click on virtual directory.

3. Select add as an application and finish it.

4. The virtual directory folder icon will be change to web icon.

5. Done, browse it. Your application will work as dove and chill :-)

One more solution:

http://social.msdn.microsoft.com/Forums/da-DK/msbuild/thread/238eeead-482f-4d82-b26f-37f2ef543b40