Configuration Error "<authentication mode="Windows" />" + 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 co RRS feed

  • Question

  • User-1297834874 posted


    I have created an asp.net web app in localhost and after publish it in run time I get this 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.

    Source Error:

    Line 30:             ASP.NET to identify an incoming user. 
    Line 31:         -->
    Line 32:     <authentication mode="Windows" />
    Line 33:     <!--
    Line 34:             The <customErrors> section enables configuration 

    IIS 7 on Windows 2008 r2 (64 bits) server. runing on Microsoft .NET Framework Version:2.0.50727.4927

    • The appWeb is well created.
    • All Roles Availables in IIS.(Windows Authentication).
    • Each win32 ApplicationPools enabled set to TRUE.
    • IIS Windows Authentication enabled on WebSite.

    This is my web.config file:

    <?xml version="1.0"?>


        <sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
          <section name="Tenaris.Web.UI.Sheets.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />

          <add name="Remote.Disable" value="1"/>

                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" />
                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 mode="Off"/>
          <setting name="Tenaris_DataSheets_Web_DataSource_DataSourceSvc" serializeAs="String">
          <setting name="Tenaris_DataSheets_Web_Search_SearchService" serializeAs="String">

    Best Regards, Jorge Maro.

    Wednesday, June 2, 2010 9:33 AM


All replies

  • User-2064283741 posted

    Have you made the virtiual directory an applciation?

    How are you "publishing" your app?



    Wednesday, June 2, 2010 10:03 AM
  • User-1297834874 posted


    I put the directory under a webSite where I have others web applications working fine.

    Above directory is my app created. this is the complete structure in IIS.

    • TTR is the web site.
    • SheetWeb is the virtual directory.
    • 2.00 is the application.

    I publish it from vstudio 2008 at proyect > publish to a temp folder shared on the web server (not direct to wwwroot folder) then manually I copy from a remote desktop connection to the server the entire application to it's current wwwroot app. folder.

    Regards, Jorge Maro

    Wednesday, June 2, 2010 12:22 PM
  • User744767459 posted


    Have you resolved this issue? If your problem persists, please post the "Source File:" line in the error information and the output of the following command here:

    C:\windows\system32\inetsrv>appcmd list config -section:system.applicationhost/sites

    Here is an article about site and application, for your information:

    Understanding Sites, Applications, and Virtual Directories on IIS 7


    • Marked as answer by Anonymous Tuesday, September 28, 2021 12:00 AM
    Monday, June 7, 2010 3:56 AM