Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Dave de Moel 122 posts 574 karma points c-trib
    Oct 14, 2015 @ 09:17
    Dave de Moel
    0

    Umbraco 7.3 - MembershipProvider issues

    Hello guys and gals,

    I have a problem upgrading an Umbraco 7.2.8 project to Umbraco 7.3.0

    The upgrade itself went fine. however when I now try to run the project I get the following error:

    Unable to cast object of type 'umbraco.providers.UsersMembershipProvider' to type 'Umbraco.Core.Security.UmbracoMembershipProviderBase'.

    It also produces the following stack trace:

    [InvalidCastException: Unable to cast object of type 'umbraco.providers.UsersMembershipProvider' to type 'Umbraco.Core.Security.UmbracoMembershipProviderBase'.]
       Umbraco.Web.UmbracoDefaultOwinStartup.Configuration(IAppBuilder app) +63
    
    [TargetInvocationException: Exception has been thrown by the target of an invocation.]
       System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) +0
       System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments) +92
       System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +136
       Owin.Loader.<>c__DisplayClass12.<MakeDelegate>b__b(IAppBuilder builder) +66
       Owin.Loader.<>c__DisplayClass1.<LoadImplementation>b__0(IAppBuilder builder) +123
       Microsoft.Owin.Host.SystemWeb.<>c__DisplayClass2.<InitializeBlueprint>b__0(IAppBuilder builder) +71
       Microsoft.Owin.Host.SystemWeb.OwinAppContext.Initialize(Action`1 startup) +462
       Microsoft.Owin.Host.SystemWeb.OwinBuilder.Build(Action`1 startup) +40
       Microsoft.Owin.Host.SystemWeb.OwinHttpModule.InitializeBlueprint() +70
       System.Threading.LazyInitializer.EnsureInitializedCore(T& target, Boolean& initialized, Object& syncLock, Func`1 valueFactory) +115
       Microsoft.Owin.Host.SystemWeb.OwinHttpModule.Init(HttpApplication context) +106
       System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +534
       System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +172
       System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +352
       System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +296
    
    [HttpException (0x80004005): Exception has been thrown by the target of an invocation.]
       System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +9924184
       System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +101
       System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +261
    
  • Dave de Moel 122 posts 574 karma points c-trib
    Oct 15, 2015 @ 07:03
    Dave de Moel
    0

    So far, I have not been able to find a solution (clean install is not an option) Can anyone advise? I have already tried to copy the responsible DLL's from the .zip installation file, however, this didn't work.

  • Sebastiaan Janssen 5058 posts 15520 karma points MVP admin hq
    Oct 15, 2015 @ 12:22
    Sebastiaan Janssen
    102

    What does your membership provider section in web.config look like?

  • Dave de Moel 122 posts 574 karma points c-trib
    Oct 15, 2015 @ 12:32
    Dave de Moel
    0

    Ah yes, that was the problem :O Somehow the membership provider for members did update, but the one for users didn't :O It still pointed to 'umbraco.providers.UserMembershipProvider' instead of 'Umbraco.Web.Security.Providers.UsersMembershipProvider, Umbraco'

  • Bunnynut 136 posts 318 karma points
    Aug 08, 2016 @ 08:21
    Bunnynut
    0

    Hi Dave,

    I'm having the exact same issues, could you please post the exact changes you made to the web.config?

    Thanks in advance.

  • Sebastiaan Janssen 5058 posts 15520 karma points MVP admin hq
    Aug 08, 2016 @ 08:52
    Sebastiaan Janssen
    1

    It should look like this, this is the default that Umbraco ships with:

    <membership defaultProvider="UmbracoMembershipProvider" userIsOnlineTimeWindow="15">
      <providers>
        <clear/>
        <add name="UmbracoMembershipProvider" type="Umbraco.Web.Security.Providers.MembersMembershipProvider, Umbraco" minRequiredNonalphanumericCharacters="0" minRequiredPasswordLength="8" useLegacyEncoding="true" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" defaultMemberTypeAlias="Member" passwordFormat="Hashed"/>
        <add name="UsersMembershipProvider" type="Umbraco.Web.Security.Providers.UsersMembershipProvider, Umbraco" minRequiredNonalphanumericCharacters="0" minRequiredPasswordLength="8" useLegacyEncoding="true" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" passwordFormat="Hashed"/>
      </providers>
    </membership>
    
  • Bunnynut 136 posts 318 karma points
    Aug 08, 2016 @ 09:04
    Bunnynut
    0

    Hij Sebastiaan,

    Thanks for your quick reply, that did the trick!

  • Tuan Nguyen 26 posts 166 karma points
    Dec 02, 2016 @ 07:07
    Tuan Nguyen
    0

    Thanks Jan,

    I really useful for me.

    Thanks Tuan Nguyen.

  • Pramod Bhagat 9 posts 79 karma points
    Sep 26, 2018 @ 04:49
    Pramod Bhagat
    0

    Hi,

    I'm doing an upgrade from v6.1.6 to v7.12.3 (current latest version) and the changes to membership provider wasn't mentioned in the documentation or have I missed out anything?

    Based on your recommendation I've now updated the Membership provider. Do you think this is correct? Current site uses SqlServerMembershipProvider hence I've left defaultProvider as SqlServerMembershipProvider.

    Although the error is gone but this has introduced different other issues with missing objects in Umbraco database.

    <membership defaultProvider="SqlServerMembershipProvider" hashAlgorithmType="SHA1" userIsOnlineTimeWindow="10">
      <providers>
        <clear />
        <add name="UmbracoMembershipProvider" type="Umbraco.Web.Security.Providers.MembersMembershipProvider, Umbraco" minRequiredNonalphanumericCharacters="0" minRequiredPasswordLength="10" useLegacyEncoding="false" enablePasswordRetrieval="false" enablePasswordReset="false" requiresQuestionAndAnswer="false" defaultMemberTypeAlias="Member" passwordFormat="Hashed" allowManuallyChangingPassword="false" />
                <add name="UsersMembershipProvider" type="Umbraco.Web.Security.Providers.UsersMembershipProvider, Umbraco" enablePasswordRetrieval="false" enablePasswordReset="false" requiresQuestionAndAnswer="false" passwordFormat="Hashed" />
        <add name="SqlServerMembershipProvider" type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" connectionStringName="IvisSecurity" requiresQuestionAndAnswer="false" applicationName="Ivis" requiresUniqueEmail="true" passwordFormat="Hashed" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="8" minRequiredNonalphanumericCharacters="1" passwordAttemptWindow="10" passwordStrengthRegularExpression=""/>
      </providers>
    

    Has anyone come across this issue?

    Thanks,

    Pramod

Please Sign in or register to post replies

Write your reply to:

Draft