[Solved-5 Solutions] Error: allowDefinition='MachineToApplication' beyond application level
Error Description:
- While running an application we get an 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.
Solution 1:
The only way to consistently get round the issue is:
- Clean solution whilst your solution is configured in Release mode.
- Clean solution whilst your solution is configured in Debug mode.
- Build whilst your solution is configured in Debug mode.
Solution 2:
- Just
Clean
the project and the error goes away.
Solution 3:
- Just delete the bin and obj folders, run a Clean Solution and build it again, this time without any problem.
Solution 4:
- You need to set up the directory you've placed the website as a web application within IIS.
Solution 5:
- This error occurs when you attempt to open a project as a website.
- The easiest way to determine if you've created a website or a project is to check your solution folder (i.e. where you saved your code) and see if you have a *.sln file in the root directory, if you do then you've created a project.