0

Im new to this, so please forgive me. What im doing is deploying my application onto the server, it works fine on my local machine but im getting errors when I try to hit the server. Here is the error below and my web.config file. I dont know what im doing wrong.

Configuration Error 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.

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 18: <add assembly="System.Design, Version=4.0.0.0, Culture=neutral, 
          PublicKeyToken=B03F5F7F11D50A3A"/>

Line 19: <add assembly="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, 
          PublicKeyToken=B77A5C561934E089"/></assemblies></compilation>
Line 20:        <authentication mode="Forms">
Line 21:            <forms loginUrl="~/Account/Login.aspx" timeout="2880"/>
Line 22:        </authentication>



    <configuration>
<connectionStrings>
    <add name="ApplicationServices" connectionString="data  
             source=.\SQLEXPRESS;Integrated  
             Security=SSPI;AttachDBFilename=|DataDirectory|\aspnetdb.mdf;User 
             Instance=true" providerName="System.Data.SqlClient"/>
</connectionStrings>
<system.web>
       <customErrors mode="Off"></customErrors>
    <compilation debug="true" strict="false" explicit="true" 
             targetFramework="4.0">
    <assemblies>
    <add assembly="System.Web.Extensions.Design, 
             Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
        <add assembly="System.Design, Version=4.0.0.0, Culture=neutral, 
              PublicKeyToken=B03F5F7F11D50A3A"/>
    <add assembly="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, 
             PublicKeyToken=B77A5C561934E089"/></assemblies></compilation>
    <authentication mode="Forms">
      <forms loginUrl="~/Account/Login.aspx" timeout="2880"/>
    </authentication>
    <membership>
      <providers>
       <clear/>
       <add name="AspNetSqlMembershipProvider" 
                type="System.Web.Security.SqlMembershipProvider" 
                connectionStringName="ApplicationServices"    
                enablePasswordRetrieval="false" 
                enablePasswordReset="true" 
                requiresQuestionAndAnswer="false" requiresUniqueEmail="false" 
                maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" 
                minRequiredNonalphanumericCharacters="0" 
                 passwordAttemptWindow="10" applicationName="/"/>
            </providers>
    </membership>
    <profile>
      <providers>
       <clear/>
        <add name="AspNetSqlProfileProvider"  
                 type="System.Web.Profile.SqlProfileProvider" 
                 connectionStringName="ApplicationServices" applicationName="/"/>
          </providers>
    </profile>
    <roleManager enabled="false">
    <providers>
    <clear/>
     <add name="AspNetSqlRoleProvider"
              type="System.Web.Security.SqlRoleProvider" 
              connectionStringName="ApplicationServices" applicationName="/"/>
    <add name="AspNetWindowsTokenRoleProvider" 
             type="System.Web.Security.WindowsTokenRoleProvider" applicationName="/"/>
        </providers>
    </roleManager>
</system.web>
<system.webServer>
    <modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>

Will
  • 1,084
  • 5
  • 20
  • 42

1 Answers1

0

I seem to recall this happening when you have deployed your application into a sub-folder of an existing site, and it it's web.config includes a setting that either applies to the entire site/application, and can't be modified on a per-folder basis

It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level

I'd play with your

<system.webServer> 
    <modules runAllManagedModulesForAllRequests="true"/> 
</system.webServer>

setting. Try moving it to the site's root web.config and see where that gets you, or remove it entirely.

Also, see (just from a quick Google)

Error: allowDefinition='MachineToApplication' beyond application level

http://geekswithblogs.net/ranganh/archive/2005/04/25/37609.aspx

ASP.NET IIS Web.config [Internal Server Error]

http://forums.asp.net/t/1031775.aspx/1

Community
  • 1
  • 1
3Dave
  • 28,657
  • 18
  • 88
  • 151