title: <authentication mode="forms"> configuration error on Godaddy Hosting
body: <p>I deployed a web application in Godaddy Hosting and created a virtual directory also. But when I try to access the application via URL, I get this following error</p>
  
  <hr>
  
  <blockquote>
    <p>`Server Error in '/' Application.</p>
    
    <p>Configuration Error</p>
    
    <p>Description: An error occurred during the processing of a
    configuration file required to service this request. Please review the
    specific error details below and modify your configuration file
    appropriately. </p>
    
    <p>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.</p>
  </blockquote>
  
  <p>Source Error: </p>
  
  <p><code>&lt;/assemblies&gt;</code><br>
  <code>&lt;/compilation&gt;</code>
  <code>&lt;authentication mode="Forms"&gt;</code>
  <code>&lt;forms loginUrl="~/Account/LogOn" timeout="2880" /&gt;</code></p>
  
  <h2><code>&lt;/authentication&gt;</code></h2>
  
  <p>I tried to google it and almost most of the answers are related to virtual directory. I have attached my web.config here. </p>
  
  <p>I checked with the hosting support also, but they say, it could be coding error. So let me know, if I have to think in other prespective.</p>
  
  <hr>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;!--
  For more information on how to configure your ASP.NET application, please visit
    http://go.microsoft.com/fwlink/?LinkId=152368
    --&gt;
  `&lt;configuration&gt;`
     `&lt;connectionStrings&gt;
      &lt;add name="ApplicationServices" connectionString="data            source=.\SQLEXPRESS;Integrated     Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true"     providerName="System.Data.SqlClient" /&gt;
      &lt;add name="fbpmProjectDetailsEntities"        connectionString="metadata=res://*/Models.ProjectDetail.csdl|res://*/Models.ProjectDetail.ss    dl|res://*/Models.ProjectDetail.msl;provider=System.Data.SqlClient;provider connection     string=&amp;quot;data source=.\SQLEXPRESS;attachdbfilename=|DataDirectory|\fbpm.mdf;integrated     security=True;user instance=True;multipleactiveresultsets=True;App=EntityFramework&amp;quot;"     providerName="System.Data.EntityClient" /&gt;
      &lt;add name="fbpmUserEntities"      connectionString="metadata=res://*/Models.UserModel.csdl|res://*/Models.UserModel.ssdl|res:/    /*/Models.UserModel.msl;provider=System.Data.SqlClient;provider connection      string=&amp;quot;data source=.\SQLEXPRESS;attachdbfilename=|DataDirectory|\fbpm.mdf;integrated     security=True;user instance=True;multipleactiveresultsets=True;App=EntityFramework&amp;quot;"     providerName="System.Data.EntityClient" /&gt;
      &lt;add name="fbpmUserPaySchedEntities"      connectionString="metadata=res://*/Models.UserPaymentSchedule.csdl|res://*/Models.UserPaymentSchedule.ssdl|res://*/Models.UserPaymentSchedule.msl;provider=System.Data.SqlClient;provide    r connection string=&amp;quot;data     source=.\SQLEXPRESS;attachdbfilename=|DataDirectory|\fbpm.mdf;integrated security=True;user     instance=True;multipleactiveresultsets=True;App=EntityFramework&amp;quot;"     providerName="System.Data.EntityClient" /&gt;
    &lt;/connectionStrings&gt;
    &lt;appSettings&gt;
      &lt;add key="webpages:Version" value="1.0.0.0" /&gt;
      &lt;add key="ClientValidationEnabled" value="true" /&gt;
      &lt;add key="UnobtrusiveJavaScriptEnabled" value="true" /&gt;
    &lt;/appSettings&gt;
    &lt;system.web&gt;
      &lt;compilation debug="true" targetFramework="4.0"&gt;
        &lt;assemblies&gt;
          &lt;add assembly="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral,     PublicKeyToken=31BF3856AD364E35" /&gt;
          &lt;add assembly="System.Web.Helpers, Version=1.0.0.0, Culture=neutral,   PublicKeyToken=31BF3856AD364E35" /&gt;
          &lt;add assembly="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /&gt;
          &lt;add assembly="System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /&gt;
          &lt;add assembly="System.Web.WebPages, Version=1.0.0.0, Culture=neutral,  PublicKeyToken=31BF3856AD364E35" /&gt;
          &lt;add assembly="System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /&gt;
        &lt;/assemblies&gt;
      &lt;/compilation&gt;
      &lt;authentication mode="Forms"&gt;
        &lt;forms loginUrl="~/Account/LogOn" timeout="2880" /&gt;
      &lt;/authentication&gt;
      &lt;membership&gt;
    &lt;providers&gt;
      &lt;clear /&gt;
      &lt;add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="ApplicationServices" enablePasswordRetrieval="true" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="true" maxInvalidPasswordAttempts="3" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="1" passwordAttemptWindow="10" applicationName="/" /&gt;
    &lt;/providers&gt;
  &lt;/membership&gt;
  &lt;profile&gt;
    &lt;providers&gt;
      &lt;clear /&gt;
      &lt;add name="AspNetSqlProfileProvider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="ApplicationServices" applicationName="/" /&gt;
    &lt;/providers&gt;
  &lt;/profile&gt;
  &lt;roleManager enabled="true"&gt;
    &lt;providers&gt;
      &lt;clear /&gt;
      &lt;add connectionStringName="ApplicationServices" applicationName="/"
        name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider" /&gt;
      &lt;add applicationName="/" name="AspNetWindowsTokenRoleProvider"
        type="System.Web.Security.WindowsTokenRoleProvider" /&gt;
    &lt;/providers&gt;
  &lt;/roleManager&gt;
  &lt;pages&gt;
    &lt;namespaces&gt;
      &lt;add namespace="System.Web.Helpers" /&gt;
      &lt;add namespace="System.Web.Mvc" /&gt;
      &lt;add namespace="System.Web.Mvc.Ajax" /&gt;
      &lt;add namespace="System.Web.Mvc.Html" /&gt;
      &lt;add namespace="System.Web.Routing" /&gt;
      &lt;add namespace="System.Web.WebPages" /&gt;
    &lt;/namespaces&gt;
  &lt;/pages&gt;
  &lt;customErrors mode="Off"/&gt;
    &lt;/system.web&gt;
    &lt;system.webServer&gt;
        &lt;modules runAllManagedModulesForAllRequests="false"&gt;
            &lt;remove name="FormsAuthenticationModule" /&gt;
            &lt;add name="FormsAuthenticationModule"     type="System.Web.Security.FormsAuthenticationModule" /&gt;
            &lt;remove name="UrlAuthorization" /&gt;
            &lt;add name="UrlAuthorization" type="System.Web.Security.UrlAuthorizationModule"     /&gt;
        &lt;/modules&gt;
      &lt;validation validateIntegratedModeConfiguration="false" /&gt;
     &lt;!--&lt;modules runAllManagedModulesForAllRequests="true" /&gt;--&gt;
    &lt;/system.webServer&gt;
    &lt;runtime&gt;
      &lt;assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"&gt;
        &lt;dependentAssembly&gt;
          &lt;assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" /&gt;
          &lt;bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="3.0.0.0" /&gt;
       &lt;/dependentAssembly&gt;
      &lt;/assemblyBinding&gt;
    &lt;/runtime&gt;
  &lt;/configuration&gt;`
  </code></pre>
  
  <hr>
  
  <p>Please help me to identify the issue.</p>
  
  <p>Thanks, Senti</p>