We are excited to announce that the IIS.NET Forums are moving to the new Microsoft Q&A experience. Learn more >

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 [Answered]RSS

3 replies

Last post Jun 07, 2010 03:56 AM by Leo Tang - MSFT

  • Configuration Error "<authentication mode="Windows" />" + It is an error to use a section registe...

    Jun 02, 2010 09:33 AM|jortacua|LINK

    Hi,

    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

    • <div mce_keep="true">The appWeb is well created.</div>
    • <div mce_keep="true">All Roles Availables in IIS.(Windows Authentication).</div>
    • <div mce_keep="true">Each win32 ApplicationPools enabled set to TRUE.</div>
    • <div mce_keep="true">IIS Windows Authentication enabled on WebSite.</div>

    This is my web.config file:

    <?xml version="1.0"?>

    <configuration>

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

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

      <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" />
        <!--
                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>
         -->
        <customErrors mode="Off"/>
      </system.web>
      <applicationSettings>
        <Tenaris.Web.UI.Sheets.Properties.Settings>
          <setting name="Tenaris_DataSheets_Web_DataSource_DataSourceSvc" serializeAs="String">
            <value>http://ttr.saar.apre.siderca.ot/Services/DataSource/2.00/DataSource.asmx</value>
          </setting>
          <setting name="Tenaris_DataSheets_Web_Search_SearchService" serializeAs="String">
            <value>http://ttr.saar.apre.siderca.ot/Services/Search/1.02/Search.asmx</value>
          </setting>
        </Tenaris.Web.UI.Sheets.Properties.Settings>
      </applicationSettings>
    </configuration>

    Best Regards, Jorge Maro.

  • Rovastar Rovastar

    5495 Posts

    MVP

    Moderator

    Re: Configuration Error "<authentication mode="Windows" />" + It is an error to use a section reg...

    Jun 02, 2010 10:03 AM|Rovastar|LINK

    Have you made the virtiual directory an applciation?

    How are you "publishing" your app?

     

     

    Troubleshoot IIS in style
    https://www.leansentry.com/
  • Re: Configuration Error "<authentication mode="Windows" />" + It is an error to use a section reg...

    Jun 02, 2010 12:22 PM|jortacua|LINK

    Hi, 

    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.

    • <div mce_keep="true">TTR is the web site.</div>
    • <div mce_keep="true">SheetWeb is the virtual directory.</div>
    • <div mce_keep="true">2.00 is the application.</div>

    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

  • Re: Configuration Error "<authentication mode="Windows" />" + It is an error to use a section reg...

    Jun 07, 2010 03:56 AM|Leo Tang - MSFT|LINK

    Hi,

    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
    http://learn.iis.net/page.aspx/150/understanding-sites-applications-and-virtual-directories-on-iis-7/

    Thanks.

    Please mark the replies as answers if they help or unmark if not.
    Feedback to us