Error: allowDefinition=’MachineToApplication’ beyond application level

I have downloaded the online project in ASP.Net. While running application I 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.

What changes should i make in web.config or elsewhere to make this work?

36 Answers
36

I’ve just encountered this “delight”. It seems to present itself just after I’ve published a web application in release mode.

The only way to consistently get round the issue that I’ve found is to follow this checklist:

  1. Clean solution whilst your solution is configured in Release mode.
  2. Clean solution whilst your solution is configured in Debug mode.
  3. Build whilst your solution is configured in Debug mode.

Leave a Comment