Copied to clipboard

Flag this post as spam?

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


  • Brendan Rice 538 posts 1100 karma points
    Nov 12, 2012 @ 01:18
    Brendan Rice
    0

    On Member.Save - An item with the same key has already been added.

    I am coding up a password reset user control (see code below) but when the code hits cMember.Save I get an error (shown below). This also happens in the back office when I try to save a user, can anyone help please?

                    Member cMember = Member.GetMemberFromEmail(tbEmail.Text);

                    // Found the user
                    var password = Membership.GeneratePassword(10, 1);
                    password = Regex.Replace(password, @"[^a-zA-Z0-9]", m => "9");

                    // Change the password
                    cMember.ChangePassword(password);

                    // Save the password
                    cMember.Save();

  • Brendan Rice 538 posts 1100 karma points
    Nov 12, 2012 @ 01:19
    Brendan Rice
    0

    Stack trace

    (sorry about the duplicate post the forum is playign up) 

    Server Error in '/' Application.


    An item with the same key has already been added.

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

    Exception Details: System.ArgumentException: An item with the same key has already been added.

    Source Error: 

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.


    Stack Trace: 

    [ArgumentException: An item with the same key has already been added.]
       System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add) +14119204
       Examine.LuceneEngine.Providers.LuceneIndexer.GetDataToIndex(XElement node, String type) +679
       UmbracoExamine.UmbracoMemberIndexer.GetDataToIndex(XElement node, String type) +11
       Examine.LuceneEngine.Providers.LuceneIndexer.AddNodesToIndex(IEnumerable`1 nodes, String type) +211
       Examine.LuceneEngine.Providers.LuceneIndexer.ReIndexNode(XElement node, String type) +188
       Examine.ExamineManager._ReIndexNode(XElement node, String type, IEnumerable`1 providers) +93
       umbraco.cms.businesslogic.member.SaveEventHandler.Invoke(Member sender, SaveEventArgs e) +0
       umbraco.cms.businesslogic.member.Member.Save() +332
       GordonHouse.App.UserControls.ForgotPassword.BtnSubmitClick(Object sender, EventArgs e) +529
       System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +155
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3804
    



    Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.17929

  • Tim 15 posts 35 karma points
    Nov 12, 2012 @ 02:33
    Tim
    0

    From stack trace looks like it's falling over trying to reindex.

    Have you tried deleting your Lucene indexes?

    ie delete this folder: \App_Data\TEMP\ExamineIndexes

    They'll get regenerated on build/save.

Please Sign in or register to post replies

Write your reply to:

Draft