locked
Could not load file or assembly 'System.Web.Providers RRS feed

  • Question

  • User-862012937 posted

    What am I missing here..... I get this error when I attempt to login or create a new account. 

    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: Could not load file or assembly 'System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.

    Source Error:

    Line 33:     <membership defaultProvider="DefaultMembershipProvider">
    Line 34:       <providers>
    Line 35:         <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="/" />
    Line 36:       </providers>
    Line 37:     </membership>

    My Code:

    <authentication mode="Forms">
          <forms loginUrl="~/account/Login.aspx" timeout="2880" defaultUrl="~/" />
        </authentication>
        <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>

    Monday, September 1, 2014 6:27 PM

Answers

  • User-760709272 posted

    The 2.0.0 tends to suggest it'll be version 2.0.0.0.  Either update the config file to look for vs 2.0.0.0 and see if it works, or google what nuget command will get you exactly the version you need, as just adding tends to give you the latest version, whatever that is.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, September 1, 2014 8:26 PM

All replies

  • User-760709272 posted

    Add a reference to System.Web.Providers to your project.

    Monday, September 1, 2014 7:27 PM
  • User-862012937 posted

    I used NuGet to install System.Web.Providers

    I now have the dll's in my Bin and the following in my web.config

    <authentication mode="Forms">
          <forms loginUrl="~/account/Login.aspx" timeout="2880" defaultUrl="~/" />
        </authentication>
        <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>

    I am still getting:

    Could not load file or assembly 'System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

    Source Error:

    Line 33:     <membership defaultProvider="DefaultMembershipProvider">
    Line 34:       <providers>
    Line 35:         <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="/" />
    Line 36:       </providers>
    Line 37:     </membership>
    Monday, September 1, 2014 8:12 PM
  • User-760709272 posted

    Check it's the right version of the dll, 1.0.0.0 or whatever.

    Monday, September 1, 2014 8:15 PM
  • User-862012937 posted

    "Successfully added 'Microsoft.AspNet.Providers.Core 2.0.0' to BSW2."

    How do I check to see if it's the right version?

    Monday, September 1, 2014 8:17 PM
  • User-760709272 posted

    The 2.0.0 tends to suggest it'll be version 2.0.0.0.  Either update the config file to look for vs 2.0.0.0 and see if it works, or google what nuget command will get you exactly the version you need, as just adding tends to give you the latest version, whatever that is.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, September 1, 2014 8:26 PM