Sections must only appear once per config file

Nick_M

so yesterday this code was working just fine and today as we went to run the site we are getting this configuration error. I have looked through the other questions asked and although they were helpful I have not been able to pinpoint where I am repeating a section.

Here is my error: http://img.photobucket.com/albums/v506/Himaro/Programming/ConfigurationError.jpgenter image description here

and the code in my web.config:

    <configuration>
  <configSections>
    <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
    <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
  </configSections>
  <appSettings>
    <add key="webpages:Version" value="2.0.0.0" />
    <add key="webpages:Enabled" value="false" />
    <add key="PreserveLoginUrl" value="true" />
    <add key="ClientValidationEnabled" value="true" />
    <add key="UnobtrusiveJavaScriptEnabled" value="true" />
  </appSettings>
  <connectionStrings>
    <add name="DashboardSiteConnectionString" connectionString="Data Source=ZGAWS152;Initial Catalog=DashboardSite;Integrated Security=True" providerName="System.Data.SqlClient" />
    <add name="CHASE_NJBConnectionString" connectionString="Data Source=ZGAWS152;Initial Catalog=CHASE-NJB;Integrated Security=True" providerName="System.Data.SqlClient" />
    <add name="DefaultConnection" providerName="System.Data.SqlClient" connectionString="Data Source=(LocalDb)\v11.0;Initial Catalog=aspnet-4SDashboard.DashboardSite-20131227074234;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnet-4SDashboard.DashboardSite-20131227074234.mdf" />
  </connectionStrings>
  <system.web>
    <compilation debug="true" targetFramework="4.5" />
    <pages controlRenderingCompatibilityVersion="4.0">
      <namespaces>
        <add namespace="System.Web.Helpers" />
        <add namespace="System.Web.Mvc" />
        <add namespace="System.Web.Mvc.Ajax" />
        <add namespace="System.Web.Mvc.Html" />
        <add namespace="System.Web.Routing" />
        <add namespace="System.Web.WebPages" />
      </namespaces>
    </pages>
    <authentication mode="Forms">
      <forms loginUrl="~/Account/Login" />
    </authentication>
    <membership defaultProvider="DefaultProvider">
      <providers>
        <add name="DefaultProvider" type="WebMatrix.WebData.SimpleMembershipProvider, WebMatrix.WebData" />
      </providers>
    </membership>
    <roleManager enabled="true" defaultProvider="DefaultProvider">
      <providers>
        <add name="DefaultProvider" type="WebMatrix.WebData.SimpleRoleProvider, WebMatrix.WebData" />
      </providers>
    </roleManager>
    <profile defaultProvider="DefaultProfileProvider">
      <providers>
        <add name="DefaultProfileProvider" type="System.Web.Providers.DefaultProfileProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" connectionStringName="DefaultConnection" applicationName="/" />
      </providers>
    </profile>
    <membership defaultProvider="DefaultMembershipProvider">
      <providers>
        <add name="DefaultMembershipProvider" type="System.Web.Providers.DefaultMembershipProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" connectionStringName="DefaultConnection" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" applicationName="/" />
      </providers>
    </membership>
    <roleManager defaultProvider="DefaultRoleProvider">
      <providers>
        <add name="DefaultRoleProvider" type="System.Web.Providers.DefaultRoleProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" connectionStringName="DefaultConnection" applicationName="/" />
      </providers>
    </roleManager>
    <sessionState mode="InProc" customProvider="DefaultSessionProvider">
      <providers>
        <add name="DefaultSessionProvider" type="System.Web.Providers.DefaultSessionStateProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" connectionStringName="DefaultConnection" />
      </providers>
    </sessionState>
  </system.web>
  <system.webServer>
    <validation validateIntegratedModeConfiguration="false" />
    <modules runAllManagedModulesForAllRequests="true" />
    <handlers>
      <remove name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" />
      <remove name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" />
      <remove name="ExtensionlessUrlHandler-Integrated-4.0" />
      <add name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness32" responseBufferLimit="0" />
      <add name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness64" responseBufferLimit="0" />
      <add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
    </handlers>
  </system.webServer>
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-1.5.2.14234" newVersion="1.5.2.14234" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Web.Optimization" publicKeyToken="31bf3856ad364e35" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-1.1.0.0" newVersion="1.1.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="EntityFramework" publicKeyToken="b77a5c561934e089" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
  <entityFramework>
    <defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
      <parameters>
        <parameter value="v11.0" />
      </parameters>
    </defaultConnectionFactory>
    <providers>
      <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
    </providers>
  </entityFramework>
</configuration>

Thank you all in advance for the help, I'm sure it's something small I'm missing. Been staring at the code for too long maybe.

vee

You have multiple membership providers defined separately:

<membership defaultProvider="DefaultProvider">
  <providers>
    <add name="DefaultProvider" type="WebMatrix.WebData.SimpleMembershipProvider, WebMatrix.WebData" />
  </providers>
</membership>
...
<membership defaultProvider="DefaultMembershipProvider">
  <providers>
    <add name="DefaultMembershipProvider" type="System.Web.Providers.DefaultMembershipProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" connectionStringName="DefaultConnection" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" applicationName="/" />
  </providers>
</membership>

Removing one of them should get rid of that error. But if you need to have both providers then update as follows:

<membership defaultProvider="MembershipProvider2">
  <providers>
    <add name="MembershipProvider1" type="WebMatrix.WebData.SimpleMembershipProvider, WebMatrix.WebData" />
    <add name="MembershipProvider2" type="System.Web.Providers.DefaultMembershipProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" connectionStringName="DefaultConnection" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" applicationName="/" />
  </providers>
</membership>

Here MembershipProvider2 is set as defaultProvider just for example. You would update this with whichever providers you need to use as default.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

API to modify the machine.config file - 'DbProviderFactories' section can only appear once per config file

From Dev

API to modify the machine.config file - 'DbProviderFactories' section can only appear once per config file

From Dev

SQLite Error: The 'DbProviderFactories' section can only appear once per config file (IBM Client Access)

From Dev

<!DOCTYPE html> - Document Type Declaration must appear only once

From Dev

Iterate over sections in a config file

From Dev

Multiple repeated sections in a config file

From Dev

Find words that appear only once

From Dev

Lightbox Popup to appear only ONCE

From Dev

How to count occurrences of a word in all the files of a directory? But with count incremented only once per word per file

From Dev

How to have a collection of configuration sections in a .config file

From Dev

Config file for Python with repeated sections/objects

From Dev

Sorting sections in a config file using configparser

From Dev

Adding config file entries to specific sections

From Dev

SQL Omitting rows that only appear once

From Dev

CountVectorizer deleting features that only appear once

From Dev

animate listView childs only once they appear

From Dev

Remove values that appear only once in a DataFrame column

From Dev

How To Make an Alert Only Appear Once

From Dev

Configuring a bootstrap popover to appear only once?

From Dev

CountVectorizer deleting features that only appear once

From Dev

Trying to make array element appear only once

From Dev

Return numbers which appear only once (JavaScript)

From Dev

Groups of unique pairs where members appear once per group

From Dev

Increment counter ONLY once per item click

From Dev

Display A Popup Only Once Per User

From Dev

Javascript replace() only once per occurrence

From Dev

Javascript replace() only once per occurrence

From Dev

Ensure partial is only included once per page

From Dev

Show div only once per user session?

Related Related

  1. 1

    API to modify the machine.config file - 'DbProviderFactories' section can only appear once per config file

  2. 2

    API to modify the machine.config file - 'DbProviderFactories' section can only appear once per config file

  3. 3

    SQLite Error: The 'DbProviderFactories' section can only appear once per config file (IBM Client Access)

  4. 4

    <!DOCTYPE html> - Document Type Declaration must appear only once

  5. 5

    Iterate over sections in a config file

  6. 6

    Multiple repeated sections in a config file

  7. 7

    Find words that appear only once

  8. 8

    Lightbox Popup to appear only ONCE

  9. 9

    How to count occurrences of a word in all the files of a directory? But with count incremented only once per word per file

  10. 10

    How to have a collection of configuration sections in a .config file

  11. 11

    Config file for Python with repeated sections/objects

  12. 12

    Sorting sections in a config file using configparser

  13. 13

    Adding config file entries to specific sections

  14. 14

    SQL Omitting rows that only appear once

  15. 15

    CountVectorizer deleting features that only appear once

  16. 16

    animate listView childs only once they appear

  17. 17

    Remove values that appear only once in a DataFrame column

  18. 18

    How To Make an Alert Only Appear Once

  19. 19

    Configuring a bootstrap popover to appear only once?

  20. 20

    CountVectorizer deleting features that only appear once

  21. 21

    Trying to make array element appear only once

  22. 22

    Return numbers which appear only once (JavaScript)

  23. 23

    Groups of unique pairs where members appear once per group

  24. 24

    Increment counter ONLY once per item click

  25. 25

    Display A Popup Only Once Per User

  26. 26

    Javascript replace() only once per occurrence

  27. 27

    Javascript replace() only once per occurrence

  28. 28

    Ensure partial is only included once per page

  29. 29

    Show div only once per user session?

HotTag

Archive