Copied to clipboard

Flag this post as spam?

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


  • Ranga 2 posts 22 karma points
    Oct 20, 2011 @ 06:42
    Ranga
    0

    Issue when creating member with extended properties

    I am working on umbraco v. 4.7 and need to create umbraco members using the API. 

    First I create a member type in Umbraco site(called 'PowerUser'). Then it added to the web.config file as a "defaultMemberTypeAlias".

    <add name="MembershipProv" type="umbraco.providers.members.UmbracoMembershipProvider" connectionStringName="MembershipConn" defaultMemberTypeAlias="PowerUser" enablePasswordRetrieval="false" enablePasswordReset="false" requiresQuestionAndAnswer="false" passwordFormat="Hashed"/>

    Then I was able to create a New member with the following code without any issues.

     Membership.CreateUser(userName, password, email);

    Then I add a new property to the member type. (called 'FirstName'). Then I try to create new member it throws the following error. 

    Exception Details: System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.

    Your help to resolve this issue is highly appreciated.

     

  • Thomas 49 posts 78 karma points c-trib
    Oct 29, 2011 @ 16:08
    Thomas
    0

    Do you get the error only when creating in code, or also when using the Umbraco admin screens?

    Could you post the full exception as well - cheers! 

  • Ranga 2 posts 22 karma points
    Nov 14, 2011 @ 09:07
    Ranga
    0

    I can create users in admin site. But I can't do the same in my site using Umbraco API.

  • Thomas 49 posts 78 karma points c-trib
    Nov 20, 2011 @ 18:31
    Thomas
    0

    Hi - I can't recreate this, even adding a mandatory property I am still able to create using the API.

    The "KeyNotFoundException" is a bit of a generic one that you might see from time to time in Umbraco. I would try republishing all your content (using dialogs/republish.aspx?xml=true) and then do an iisreset and try again, still get the error please post us the full exception here - cheers!

Please Sign in or register to post replies

Write your reply to:

Draft