Error on forward mapping

Thread is closed for posting
4 posts, 0 answers
  1. jr
    jr avatar
    6 posts
    Member since:
    Sep 2009

    Posted 13 Oct 2009 Link to this post

    I had the application running just fine.
    Now, when I try to run forward mapping (from Telerik menu), to update same new classes to the database, I get an error:

    Exception:  Item has already been added. Key in dictionary: 'PoloData.LO'  Key being added: 'PoloData.LO'

    Generated by the method: Void Insert(System.Object, System.Object, Boolean)

    Stack Trace:    at System.Collections.Hashtable.Insert(Object key, Object nvalue, Boolean add)
       at System.Collections.Hashtable.Add(Object key, Object value)
       at OpenAccessRuntime.DataObjects.tools.workbench.model.MdDataObjectsFile.addClassesFromCodeModel(MdDocument doc, CodeModel cm)
       at OpenAccessRuntime.DataObjects.tools.workbench.model.MdDataObjectsFile.getDocument()
       at OpenAccessRuntime.DataObjects.tools.workbench.model.MdProject.load(IMappingData[] _mappingData, IDictionary _configProps)
       at Telerik.OpenAccess.Sdk.Addin.UserControls.MdProjectHelper.CreateMdProject(VAProject project)
       at Telerik.OpenAccess.Sdk.Addin.UserControls.MdProjectHelper.GetMdProject(VAProject project)
       at Telerik.OpenAccess.Sdk.Addin.UserControls.NonPersistentUserControl.ActivateUserControl(VAProject _project)
       at Telerik.OpenAccess.Sdk.Addin.UserControls.ClassViewControl.classTreeView_AfterSelect(Object sender, TreeViewEventArgs e)

    Exception Type: System.ArgumentException


    What are the possible causes of this error? Any idea?

    Thanks





  2. Ady
    Admin
    Ady avatar
    589 posts

    Posted 14 Oct 2009 Link to this post

    Hello jr,

     This might happen if you have the same class specified twice in code(without the 'partial'  keyword) or in the mapping? Can you please verify that? Also does pressing the  'Reload' button on the wizard help?

    Regards,
    Ady
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. jr
    jr avatar
    6 posts
    Member since:
    Sep 2009

    Posted 14 Oct 2009 Link to this post

    Not really that problem.
    I don't why but app.config had 2 classes with the same name.
    Sometimes when I change a name of a class, instead of changing in app.config, it inserts a new one.
    Working now.
    Thanks
  4. Ady
    Admin
    Ady avatar
    589 posts

    Posted 16 Oct 2009 Link to this post

    Hello jr,

     In case you encounter a similar ambiguity in the mapping you can use the 'Check Settings' wizard to validate the mapping.
    Do feel free to get back to us in case you need further assistance.

    All the best,
    Ady
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Back to Top