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

Discussion in 'ASP .Net Security' started by ssp, Nov 21, 2004.

  1. ssp

    ssp Guest

    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="AXnhkjjqnRx1ytJ3T8vvjZOvsQEbkvT0HQsweHP2DdVJpYSkpAAMtt3fjT8PayjDGM2HHXkBRH/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, Nov 21, 2004
    #1
    1. Advertising

  2. ssp

    EC Guest

    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" <> wrote in message
    news:...
    > 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="AXnhkjjqnRx1ytJ3T8vvjZOvsQEbkvT0HQsweHP2DdVJpYSkpAAMtt3fjT8PayjDGM2HHXkBR
    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, Nov 22, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Alex D.
    Replies:
    1
    Views:
    9,626
    Alex D.
    May 20, 2005
  2. =?Utf-8?B?UGF0cmljayBQYXF1aW4=?=

    Precompilation Error allowDefinition='MachineToApplication'

    =?Utf-8?B?UGF0cmljayBQYXF1aW4=?=, Mar 30, 2006, in forum: ASP .Net
    Replies:
    4
    Views:
    12,610
  3. Replies:
    23
    Views:
    1,141
    Juan T. Llibre
    Nov 13, 2006
  4. Replies:
    3
    Views:
    1,135
  5. jc
    Replies:
    1
    Views:
    826
    Michael Nemtsev [MVP]
    Oct 28, 2008
Loading...

Share This Page