It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level.  [Answered]RSS

27 replies

Last post Jul 05, 2012 09:51 AM by geek4support_Admin

  • It is an error to use a section registered as allowDefinition='MachineToApplication' beyond appli...

    Feb 28, 2008 09:17 AM|vskgoud|LINK

     

    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,

  • Re: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond a...

    Feb 28, 2008 09:25 AM|tomkmvp|LINK

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

  • Re: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond a...

    Feb 28, 2008 09:26 AM|jeff@zina.com|LINK

    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

    Have you Binged a solution before posting?
  • Re: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond a...

    Feb 28, 2008 10:13 AM|vskgoud|LINK

    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,

  • Re: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond a...

    Apr 07, 2008 07:45 PM|JamesSmyth|LINK

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

  • Re: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond a...

    Apr 08, 2008 07:56 AM|tomkmvp|LINK

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

  • Re: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond a...

    Nov 30, 2008 12:24 AM|ketanbece|LINK

  • Re: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond a...

    Mar 12, 2009 12:04 PM|jonathan80|LINK

     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

  • Re: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond a...

    Mar 12, 2009 03:04 PM|tomkmvp|LINK

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

  • Re: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond a...

    Apr 02, 2009 08:35 AM|geetanshi|LINK

    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.

  • Re: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond a...

    Sep 27, 2010 09:41 AM|Wolfeitz|LINK

    If you accidentally copy your entire web app into one of its own sub-folders, you will get this error.
  • Re: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond a...

    Mar 29, 2011 05:03 AM|vaheeds|LINK

    Wolfeitz

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

    iis MachineToApplication

    I remember to mark the replies as answers if they answered my question ;)
  • Re: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond a...

    Mar 30, 2011 02:02 PM|ReginK|LINK

    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!
  • Re: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond a...

    May 24, 2011 12:31 AM|mahivepiyush|LINK

     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

  • Re: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond a...

    Jun 11, 2011 11:32 AM|Absolute_Zero|LINK

    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!
  • Re: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond a...

    Jul 14, 2011 02:29 AM|Parthiv_777|LINK

    thanks Jeff u solved my problem buddy...
  • Re: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond a...

    Jul 18, 2011 04:23 PM|leisenstein|LINK

    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.

  • Re: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond a...

    Jul 26, 2011 04:10 AM|aleksandrs.saiters|LINK

    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.
    Regards, Alexander
  • Re: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond a...

    Jul 26, 2011 01:36 PM|HCamper|LINK

    Windows and Linux work Together IT-Pros
    Community Member Award 2011
  • Re: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond a...

    Aug 18, 2011 05:59 AM|metalforgood|LINK

    jeff@zina.com

    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 ;)

     

  • Re: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond a...

    Aug 24, 2011 08:04 AM|tunsten|LINK

    Hi vskgoud, I got the same error but I got it solved just by converting the virtual directory to application. Hope this will help.
    Aweda Akeem Babatunde
  • Re: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond a...

    Sep 16, 2011 06:03 PM|jafarian|LINK

    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

  • Re: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond a...

    Sep 16, 2011 06:04 PM|jafarian|LINK

    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

  • Re: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond a...

    Oct 04, 2011 02:37 PM|szabogi|LINK

    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.

  • Re: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond a...

    Oct 19, 2011 03:09 PM|rss4306|LINK

    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
  • Re: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond a...

    Oct 19, 2011 04:07 PM|jafarian|LINK

    yes Rajiv, as it says the files shouldnt be beyond application level!!
  • Re: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond a...

    Oct 26, 2011 06:42 AM|adudley|LINK

    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
  • Re: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond a...

    Jul 05, 2012 09:51 AM|geek4support_Admin|LINK

     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

     

    virtual directory MachineToApplication error