locked
It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. RRS feed

  • Question

  • User-982453282 posted

     

    Hi, all

    This is an Error which i got:

    "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
    . "

    Thanks,

    Thursday, February 28, 2008 9:17 AM

Answers

All replies

  • User-823196590 posted

    ... so you need to go into the IIS MMC and set your directory as an application ...
    http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/b5488995-fa99-460f-96d7-29d1ddcf3fac.mspx

    • Marked as answer by Anonymous Tuesday, September 28, 2021 12:00 AM
    Thursday, February 28, 2008 9:25 AM
  • User-1853252149 posted

    Did you check to make sure the folder was configured as an application?

    Most likely you have nested web.config files.  Remove or rename the one in a folder below or above your app.

    Jeff

    • Marked as answer by Anonymous Tuesday, September 28, 2021 12:00 AM
    Thursday, February 28, 2008 9:26 AM
  • User-982453282 posted

    Hi,

    I created virtual directory and mapped to application.

    Then am trying to build the application, am getting this error message.


    "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. "

    Thanks,

    Thursday, February 28, 2008 10:13 AM
  • User-929503998 posted

    Did you check to make sure the folder was configured as an application?

    Most likely you have nested web.config files.  Remove or rename the one in a folder below or above your app.

    Can you describe this in more detail? 

     (ps. I don't want to change from Virtual Director to Application.)

    Monday, April 7, 2008 7:45 PM
  • User-823196590 posted

    The IIS MMC has an application configuration section where you can set the folder as an Application root in the IIS MMC. 

    Tuesday, April 8, 2008 7:56 AM
  • User-1184703123 posted

     Hello,

    I have Solved Same Problem Just See At

    http://dotnet-magic.blogspot.com/2008/11/it-is-error-to-use-section-registered.html

    Sunday, November 30, 2008 12:24 AM
  • User1334498986 posted

     I've had a similar error however, the ASP.NET application is not within the IIS folders, but within documents and settings'. 

     Could this be an issue?

     I've also tried including the file within IIS, and, creating the application. 

     Any ideas?

     

    web.config

    <?xml version="1.0"?>
    <!--
        Note: As an alternative to hand editing this file you can use the
        web admin tool to configure settings for your application. Use
        the Website->Asp.Net Configuration option in Visual Studio.
        A full list of settings and comments can be found in
        machine.config.comments usually located in
        \Windows\Microsoft.Net\Framework\v2.x\Config
    -->
    <configuration>
        <configSections>
            <sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
                <sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
                    <section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
                    <sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
                        <section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="Everywhere"/>
                        <section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
                        <section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
                        <section name="roleService" type="System.Web.Configuration.ScriptingRoleServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/></sectionGroup></sectionGroup></sectionGroup></configSections><appSettings/>
        <connectionStrings/>
        <system.web>
            <!--
                Set compilation debug="true" to insert debugging
                symbols into the compiled page. Because this
                affects performance, set this value to true only
                during development.
            -->
            <compilation debug="true">
                <assemblies>
                    <add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
                    <add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
                    <add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
                    <add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/></assemblies></compilation>
            <!--
                The <authentication> section enables configuration
                of the security authentication mode used by
                ASP.NET to identify an incoming user.
            -->
            <authentication mode="Windows"/>
            <!--
                The <customErrors> section enables configuration
                of what to do if/when an unhandled error occurs
                during the execution of a request. Specifically,
                it enables developers to configure html error pages
                to be displayed in place of a error stack trace.

            <customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
                <error statusCode="403" redirect="NoAccess.htm" />
                <error statusCode="404" redirect="FileNotFound.htm" />
            </customErrors>
            -->
            <pages>
                <controls>
                    <add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
                    <add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/></controls></pages>
            <httpHandlers>
                <remove verb="*" path="*.asmx"/>
                <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
                <add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
                <add verb="GET,HEAD" path="ScriptResource.axd" validate="false" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/></httpHandlers>
            <httpModules>
                <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/></httpModules></system.web>
        <system.codedom>
            <compilers>
                <compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CSharp.CSharpCodeProvider,System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" warningLevel="4">
                    <providerOption name="CompilerVersion" value="v3.5"/>
                    <providerOption name="WarnAsError" value="false"/></compiler>
                <compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" type="Microsoft.VisualBasic.VBCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" warningLevel="4">
                    <providerOption name="CompilerVersion" value="v3.5"/>
                    <providerOption name="OptionInfer" value="true"/>
                    <providerOption name="WarnAsError" value="false"/></compiler></compilers></system.codedom>
        <system.webServer>
            <validation validateIntegratedModeConfiguration="false"/>
            <modules>
                <remove name="ScriptModule"/>
                <add name="ScriptModule" preCondition="managedHandler" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/></modules>
            <handlers>
                <remove name="WebServiceHandlerFactory-Integrated"/>
                <remove name="ScriptHandlerFactory"/>
                <remove name="ScriptHandlerFactoryAppServices"/>
                <remove name="ScriptResource"/>
                <add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
                <add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
                <add name="ScriptResource" verb="GET,HEAD" path="ScriptResource.axd" preCondition="integratedMode" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/></handlers></system.webServer>
        <runtime>
            <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
                <dependentAssembly>
                    <assemblyIdentity name="System.Web.Extensions" publicKeyToken="31bf3856ad364e35"/>
                    <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/></dependentAssembly>
                <dependentAssembly>
                    <assemblyIdentity name="System.Web.Extensions.Design" publicKeyToken="31bf3856ad364e35"/>
                    <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/></dependentAssembly></assemblyBinding></runtime></configuration>
     

     

    Related links:

    http://geekswithblogs.net/ranganh/archive/2005/04/25/37609.aspx

    http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/b5488995-fa99-460f-96d7-29d1ddcf3fac.mspx?mfr=true

    Thursday, March 12, 2009 12:04 PM
  • User-823196590 posted

    It shouldn't matter where the files are - it's all about the application scope.

    Thursday, March 12, 2009 3:04 PM
  • User47328052 posted

    The error [It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level] does not occur only due to mis-configuration in web.config file.  The most important part we should care about is that the error mainly originates if we do not configure virtual directory. And you must notice that there is little bit difference in configuring probabilités du poker virtual directory in vista thatn in xp. Please search and apply the right method of publishing asp.net web project in asp.net.One more tip, is right version of asp.net enabled in your IIS? Please ensure this.Hope this helps. Please feel free to ask if any problem persists or if any help is required. Thanks.

    Thursday, April 2, 2009 8:35 AM
  • User900278226 posted
    If you accidentally copy your entire web app into one of its own sub-folders, you will get this error.
    Monday, September 27, 2010 9:41 AM
  • User143116350 posted
    If you accidentally copy your entire web app into one of its own sub-folders, you will get this error.
    THIS IS EXACTLY WHAT I WAS SEARCHING FOR ABOUT A MONTH! I FOUND THAT THERE IS A BACKUP FOLDER IN MY SOLUTION THAT CONTAINS THE WHOLE SOLUTION. AFTER I DELETE IT, THE PROBLEM WAS RESOLVED. THANK YOU SO MUCH FOR YOUR SMALL BUT VERY USEFUL TIP. I FACED THIS ERROR IN MY VISUAL STUDIO SOLUTION AND I WAS WONDERING WHERE IS MY IIS?! BECAUSE I RUN MY WEB APPLICATION ON ' ASP.NET WEB DEVELOPMENT SERVER ' WHILE DEVELOPING. DONT FORGET GUYS: "If you accidentally copy your entire web app into one of its own sub-folders, you will get this error."
    Tuesday, March 29, 2011 5:03 AM
  • User-831711305 posted
    Great! that helped solve the issue. I converted a project from Visual Studio 2008 to 2010. That process created a backup of the existing files in the application INCLUDING the web.config file. I deleted the extra web.config file from the backup folder and that error was resolved. Thanks!
    Wednesday, March 30, 2011 2:02 PM
  • User875343548 posted

     This happens whenever we try to provide multiple web.config files in multiple directories, avoid using multiple web.config and use a common one, that can solve this problem

     

     

     

    Thanks 

    Piyush Kesharwani

    Tuesday, May 24, 2011 12:31 AM
  • User1215786134 posted
    This happened to me when I migrated my project from VS 2008 to VS 2010. I told it to make a backup and just left it in the same folder, so when I went to build I got this error because the "web.config" from the backup folder was in there causing the problem. I moved the backup folder out and was then able to build just fine!
    Saturday, June 11, 2011 11:32 AM
  • User-177552116 posted
    thanks Jeff u solved my problem buddy...
    Thursday, July 14, 2011 2:29 AM
  • User2051683607 posted

    Thanks!  This was my issue.  I developed a DotNetNuke module and copied it over, leaving the web.config in there.

     Once I renamed it, it started working.

    Monday, July 18, 2011 4:23 PM
  • User-55356544 posted
    Hi! I know that this topic is old but I have same problem. I have no any backups in folder where compiled site is stored. As was suggested I converted virtual directory to application and after that browser stopped showing anything.

    Hope someone will answer.
    Tuesday, July 26, 2011 4:10 AM
  • Tuesday, July 26, 2011 1:36 PM
  • User1397415549 posted

    Did you check to make sure the folder was configured as an application?

    Most likely you have nested web.config files.  Remove or rename the one in a folder below or above your app.

    Jeff

     

    thanks a lot jeff it worked for me , i was using an ascx control as a module in dnn portal, when i removed the web.config in the application, it worked, thx ;)

     

    Thursday, August 18, 2011 5:59 AM
  • User1681267879 posted
    Hi vskgoud, I got the same error but I got it solved just by converting the virtual directory to application. Hope this will help.
    Wednesday, August 24, 2011 8:04 AM
  • User280810911 posted

    Hi

    this error is caused by level of directories that you will unzip the file to.

    Please note:

    suppose you have a website  called Myweb and all the files for this website is in   Mywebsite.zip.

    if you unzip it it will be in the following directories level:

    Mywebsite/Mywebsite/Myweb

    if you open the website in VS 2008 from 1st and 2nd level directories it will give you the above error.

    But if you opent the website form  Myweb directory it will works just fine

    So you dont need to play with IIS or other staff!!!!!!!!!!!!!!!!

    hope it helps

    Friday, September 16, 2011 6:03 PM
  • User280810911 posted

    Hi

    this error is caused by level of directories that you will unzip the file to.

    Please note:

    suppose you have a website called Myweb and all the files for this website is in Mywebsite.zip.

    if you unzip it it will be in the following directories level:

    Mywebsite/Mywebsite/Myweb

    if you open the website in VS 2008 from 1st and 2nd level directories it will give you the above error.

    But if you opent the website form Myweb directory it will works just fine

    So you dont need to play with IIS or other staff!!!!!!!!!!!!!!!!

    hope it helps

    Friday, September 16, 2011 6:04 PM
  • User534107250 posted

    Thanks, that did the trick for me.  Delete the BACKUP folder that Visual Studio created when it upsized the project to VS2010 from prior version.

    Tuesday, October 4, 2011 2:37 PM
  • User1447301562 posted
    Check you local source file folder. Look for sub-folder 'obj' and if exists, clear all the files inside that folder. Rebuild the Solution. It should take care of that error. ( I'm using VS2010 sp1, ASP.NET 4.0 on IIS 7.5) Rajiv S Suwal
    Wednesday, October 19, 2011 3:09 PM
  • User280810911 posted
    yes Rajiv, as it says the files shouldnt be beyond application level!!
    Wednesday, October 19, 2011 4:07 PM
  • User775280845 posted
    Thank you for actually stating you were using the development web server in visual studio, google picked this little gem up! I just used the new 'publish' thing, and it copies the files to a sub folder of my application, and so all went wrong. thanks again
    Wednesday, October 26, 2011 6:42 AM
  • User134299215 posted

     Hi,

    The Issue is very common while working in hosting environment and dealing with clients website issues, finally i prepared a post by myself for future references and To help hosting administrators.I posted it on my blog, you may check the below URL to check the post:

    Visit http://blog.geek4support.com

     Thanks

    Geek4Support_Admin

    http://blog.geek4support.com

     

    Thursday, July 5, 2012 9:51 AM