web.config error... allowDefinition='MachineToApplication'

Ask a Question related to ASP.NET Security, Design and Development.

  1. #1

    Default web.config error... allowDefinition='MachineToApplication'

    This one just came out of the blue! One minute it is working and the
    next minute, it drops dead with the error below...

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

    Source Error:

    Line 16: />
    Line 17:
    Line 18: <authentication mode="Forms">
    Line 19: <forms name=".XXXAUTH" protection="All"
    timeout="60"
    loginUrl="/login.aspx" />
    Line 20: </authentication>

    =========================

    Below is the full web.config code:

    ==========================
    <?xml version="1.0" encoding="utf-8" ?>
    <configuration>
    <startup>
    <supportedRuntime version="v1.1.4322" safemode="true"
    />
    </startup>

    <system.web>

    <compilation
    defaultLanguage="c#"
    debug="true"
    />

    <customErrors
    mode="Off"
    />
    <!-- start comment out -->
    <authentication mode="Forms">
    <forms name=".XXXAUTH" protection="All" timeout="60"
    loginUrl="/login.aspx" />
    </authentication>

    <authorization>
    <allow users="*" />
    </authorization>

    <trace
    enabled="false"
    requestLimit="10"
    pageOutput="false"
    traceMode="SortByTime"
    localOnly="true"
    />

    <sessionState
    mode="InProc"
    stateConnectionString="tcpip=127.0.0.1:42424"
    sqlConnectionString="data
    source=127.0.0.1;Trusted_Connection=yes"
    cookieless="false"
    timeout="20"
    />
    <!-- end comment out -->
    <globalization
    requestEncoding="utf-8"
    responseEncoding="utf-8"
    />

    </system.web>

    <appSettings>
    <!-- sqlConnection1Encrypted is the encrypted connection of
    sqlConnection1.ConnectionString.
    Encryption is not necessary if this site is hosted inhouse and
    access
    to it is not restricted heavily.
    -->
    <add key="sqlConnection1Encrypted"
    value="AXnhkjjqnRx1ytJ3T8vvjZOvsQEbkvT0HQsweHP2DdV JpYSkpAAMtt3fjT8PayjDGM2HHXkBRH/YLHvnohouzoCNMDnIyr3HFkbQFy5IInHYmwkjm7nZcjTbw2Vv+ 4lP"
    />
    </appSettings>
    </configuration>

    ==============================

    If I comment out the all code between the sections "commented" above,
    it works fine, the application runs fine, but I cant implement the
    security.

    PLease don't tell me to look "ensure that the folder is configured as
    an application...", because i've looked at that over and over again.

    Funny thing is that another similar application runs fine on my
    machine. no issues at all.

    Any ideas??
    ssp Guest

  2. Similar Questions and Discussions

    1. mssql config error
      I've just installed mssql and can't get CF to recognize the database. This is the error that is thrown: "Connection verification failed for data...
    2. Web Config Error What may be the problem?
      Hi everybody, I made my first ASP.Net application and deployed it. There came an error on the server: What may be wrong in web.config file ,...
    3. web config ERror
      my web conhig code is like this and <customErrors mode="Off"/> was set off <compilation defaultLanguage="vb" debug="true"/> <!-- CUSTOM ERROR...
    4. Error loading XML file c:\windows\microsoft.net\framework\v1.0.3705\Config\machine.config
      I had many ASP.NET web applications that I created before I had to rebuild my machine. After a fresh install of XP Pro, VS.NET 2003, etc, I now...
    5. allowDefinition='MachineToApplication'
      My web application has the following structure RootFolder - file1.aspx - file2.aspx - web.config - admin_folder - protectedFile1.aspx -...
  3. #2

    Default Re: web.config error... allowDefinition='MachineToApplication'

    Config the virtual dir for ypur app folder as an app in IIS as indicated by the
    error message.

    Open the IIS, right-click your app folder and select Properties, and then click
    the Create button on the App settion section of the Virtual Dir tab.


    "ssp" <sarnil@gmail.com> wrote in message
    news:23496d5e.0411211444.7b42bad4@posting.google.c om...
    > This one just came out of the blue! One minute it is working and the
    > next minute, it drops dead with the error below...
    >
    > ===========================
    > Parser 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.
    >
    > Source Error:
    >
    > Line 16: />
    > Line 17:
    > Line 18: <authentication mode="Forms">
    > Line 19: <forms name=".XXXAUTH" protection="All"
    > timeout="60"
    > loginUrl="/login.aspx" />
    > Line 20: </authentication>
    >
    > =========================
    >
    > Below is the full web.config code:
    >
    > ==========================
    > <?xml version="1.0" encoding="utf-8" ?>
    > <configuration>
    > <startup>
    > <supportedRuntime version="v1.1.4322" safemode="true"
    > />
    > </startup>
    >
    > <system.web>
    >
    > <compilation
    > defaultLanguage="c#"
    > debug="true"
    > />
    >
    > <customErrors
    > mode="Off"
    > />
    > <!-- start comment out -->
    > <authentication mode="Forms">
    > <forms name=".XXXAUTH" protection="All" timeout="60"
    > loginUrl="/login.aspx" />
    > </authentication>
    >
    > <authorization>
    > <allow users="*" />
    > </authorization>
    >
    > <trace
    > enabled="false"
    > requestLimit="10"
    > pageOutput="false"
    > traceMode="SortByTime"
    > localOnly="true"
    > />
    >
    > <sessionState
    > mode="InProc"
    > stateConnectionString="tcpip=127.0.0.1:42424"
    > sqlConnectionString="data
    > source=127.0.0.1;Trusted_Connection=yes"
    > cookieless="false"
    > timeout="20"
    > />
    > <!-- end comment out -->
    > <globalization
    > requestEncoding="utf-8"
    > responseEncoding="utf-8"
    > />
    >
    > </system.web>
    >
    > <appSettings>
    > <!-- sqlConnection1Encrypted is the encrypted connection of
    > sqlConnection1.ConnectionString.
    > Encryption is not necessary if this site is hosted inhouse and
    > access
    > to it is not restricted heavily.
    > -->
    > <add key="sqlConnection1Encrypted"
    >
    value="AXnhkjjqnRx1ytJ3T8vvjZOvsQEbkvT0HQsweHP2DdV JpYSkpAAMtt3fjT8PayjDGM2HHXkBR
    H/YLHvnohouzoCNMDnIyr3HFkbQFy5IInHYmwkjm7nZcjTbw2Vv+ 4lP"
    > />
    > </appSettings>
    > </configuration>
    >
    > ==============================
    >
    > If I comment out the all code between the sections "commented" above,
    > it works fine, the application runs fine, but I cant implement the
    > security.
    >
    > PLease don't tell me to look "ensure that the folder is configured as
    > an application...", because i've looked at that over and over again.
    >
    > Funny thing is that another similar application runs fine on my
    > machine. no issues at all.
    >
    > Any ideas??


    EC Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139