How To Fix "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"



TODO:

You open a website in Visual Studio, and get the dreaded "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" error message.

 

SOLUTION:

1.  Make sure you opened the site and not the parent folder.

2.  In my case, I created a folder called "backup", and copied my entire site to it.  Therefore, when I opened the site, that folder was loaded, and it too had a Web.Config file in it (since this folder contained a complete site backup).  Simple remove that Web.Config and you will be set.

 

example showing my problematic folder structure:

root

Web.Config

site folder 1

site folder 2

backup

Web.Config

site folder 1

site folder 2

 

NOTES:

The presence of the backup folder in red is the culprit.  It contained a backup copy of the root web.config, which contained entries only allowed in the root level Web.Config.

How To Get Detailed Errors From Sharepoint Application Pages



TODO:

Have you ever wanted detailed errors to be returned from your Sharepoint Application Pages?  Selecting "Detailed Errors" in IIS will not do it alone.  In addition, you need to do the additional step below.

 

SOLUTION:

Open the web.config at "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS\web.config"

Change <customErrors mode="On" /> to <customErrors mode="Off" /> under the system.web node

 

NOTES:

There are no notes on this topic

How to Fix: The web server process that was being debugged has been terminated by IIS. this can be avoided by configuring application pool setting in IIS. see help for further details.



TODO:

Have you been debugging an ASP .Net application and get the error:

"The web server process that was being debugged has been terminated by IIS. this can be avoided by configuring application pool setting in IIS. see help for further details."

 

 SOLUTION:

Go to the advanced settings in your application pool and set Ping Enabled to false.

App Pool -> Advanced ->  Ping Enabled -> Set to false

 

NOTES:

There are no notes on this topic