+1-888-365-2779
Try Now
More in this section

Forums / Migrating from 3.x to the latest Sitefinity version / Telerik UserManager not instanciating in upgrade from 3.6 to 5.2

Telerik UserManager not instanciating in upgrade from 3.6 to 5.2

6 posts, 0 answered
  1. Richard
    Richard avatar
    11 posts
    Registered:
    14 Sep 2011
    25 Jan 2013
    Link to this post
    Hi

    I've just upgraded a site from 3.6 to 5.2 and have an issue that I haven't been able to solve.

    The site has a custom control used to reset passwords. Within the reset procedure there are the following lines of code:UserManager manager = new UserManager();
    manager.DeleteUser(iMemberNumber.ToString());

     

    and the code fails on the first line when trying to create an instance of the UserManager (error is object not set to instance of an object).

    Is someone able to tell me what I"m doing wrong? I am assuming I might have an issue with membership providers and need to update the security config file - maybe??
  2. Craig Iredale
    Craig Iredale avatar
    0 posts
    Registered:
    20 Jan 2015
    25 Jan 2013
    Link to this post
    Hi Richard,

    The code you should use is:

    UserManager userManager = UserManager.GetManager();

    Kind regards,
    Craig Iredale
    the Telerik team
  3. Richard
    Richard avatar
    11 posts
    Registered:
    14 Sep 2011
    27 Jan 2013
    Link to this post

    Hi Craig

     

    Thanks for your response.

     

    I don’t have the GetManager method available (I’m using Telerik.Security version 3.7.2136.2, not the original 3.6.1936.2 that I originally started with on the 3.6 site) Is there a different version I should be using?

     

    Other than the default constructor, I have Default which looks like it returns an instance of UserManager but it gives me the same error.

     

    Could this be to do with my config files? There are some differences between the original 3.6 site config file and the 5.2 config files, but I’m a little unsure which V5.2 file or what content I should be changing.

     

    I’ve attached both my SecurityConfig and MigrationConfig files.

     

    My new V5.2 web.config contains the following

    <roleManager enabled="false"/>

    <membership defaultProvider="Default">

           <providers>

                  <clear/>

    <add name="Default" type="Telerik.Sitefinity.Security.Data.SitefinityMembershipProvider, Telerik.Sitefinity"/>

           </providers>

    </membership>

     

    The original 3.6 website had the following in its web.config file

    <roleManager enabled="true" cacheRolesInCookie="true" defaultProvider="Sitefinity">

          <providers>

            <clear />

            <add connectionStringName="DefaultConnection" applicationName="/"

    name="Sitefinity" type="Telerik.DataAccess.AspnetProviders.TelerikRoleProvider, Telerik.DataAccess" />

          </providers>

    </roleManager>

    <membership defaultProvider="Sitefinity" userIsOnlineTimeWindow="15" hashAlgorithmType="">

          <providers>

            <clear/>

    <add name="Sitefinity" connectionStringName="DefaultConnection" type="Telerik.DataAccess.AspnetProviders.TelerikMembershipProvider, Telerik.DataAccess" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" applicationName="/" requiresUniqueEmail="false" passwordFormat="Hashed" maxInvalidPasswordAttempts="5" passwordAttemptWindow="10" passwordStrengthRegularExpression="" minRequiredPasswordLength="1" minRequiredNonalphanumericCharacters="0"/>

          </providers>

    </membership>

     

    Any help would be much appreciated

  4. Veronica
    Veronica avatar
    125 posts
    Registered:
    30 Jan 2015
    29 Jan 2013
    Link to this post
    Hello,

    Thank you for the detailed information provided.

    Please note that there is a significant difference between project on 3.6 and 5.2. Could you please be more specific on what are you trying to achieve? If you need to delete user profile - please follow this help article.

    Regards,
    Veronica Milcheva
    the Telerik team
  5. Richard
    Richard avatar
    11 posts
    Registered:
    14 Sep 2011
    30 Jan 2013
    Link to this post

    Thanks for your reply Veronica.

    I see where I was going wrong, as I mentioned I was using the legacy security dll (Telerik.Security) from the v3.7sp2 site when I should have been using Telerik.Sitefinity.Security.

    Sorry, that was not clear to me.

    cheers

  6. Veronica
    Veronica avatar
    125 posts
    Registered:
    30 Jan 2015
    30 Jan 2013
    Link to this post
    Hello,

    I am glad that now it is clear for you.

    Please feel free to ask me if you have further questions.

    All the best,
    Veronica Milcheva
    the Telerik team
6 posts, 0 answered