Value cannot be null. Parameter name: persistentType

Thread is closed for posting
4 posts, 0 answers
  1. Bob
    Bob avatar
    3 posts
    Member since:
    Aug 2012

    Posted 20 May 2012 Link to this post

    I created an OpenAccess Fluent project in Visual Studio 2010.  I added a few models and some mappings.  This project built fine in VS 2010.  I then installed the latest internal build (2012.1.427.1) of OpenAccess (for VS 11 support).

    Upon building I received the following error:
    Value cannot be null.
    Parameter name: persistentType
    System.ArgumentNullException: Value cannot be null.
    Parameter name: persistentType
       at Telerik.OpenAccess.Metadata.Fluent.NavigationPropertyConfiguration.FindMetaMember(MetaPersistentType persistentType, MemberInfo targetMemberInfo)
       at Telerik.OpenAccess.Metadata.Fluent.JoinTableAssociationFactory.GetAssociationParts(Type entityType, IJoinTableColumnFilter columnFilter, AssociationPartType associationPartType)
       at Telerik.OpenAccess.Metadata.Fluent.JoinTableAssociationFactory.GetTargetJoinTableConstaintAssociationParts(Type targetType, IList`1 sourceColumns)
       at Telerik.OpenAccess.Metadata.Fluent.JoinTableAssociationFactoryBase.AddMetaConstraint(FluentMetadataSource fluentMappingSource, MetadataContainer metadataContainer)
       at Telerik.OpenAccess.Metadata.Fluent.NavigationPropertyConfiguration.AddRelationalItem(FluentMetadataSource fluentMappingSource, MetadataContainer metadataContainer, MetaTable table)
       at Telerik.OpenAccess.Metadata.Fluent.MappingConfiguration.AddSlaveAssociationMapping(FluentMetadataSource fluentMappingSource, MetadataContainer metadataContainer)
       at Telerik.OpenAccess.Metadata.Fluent.FluentMetadataSource.ProcessAssociations(MetadataContainer metadataContainer)
       at Telerik.OpenAccess.Metadata.Fluent.FluentMetadataSource.CreateModel()
       at Telerik.OpenAccess.Metadata.Fluent.FluentMetadataSource.GetModelCore(MetadataContainer old)
       at Telerik.OpenAccess.Sdk.Enhancer.Enhancer.CrossDomainRunImpl(AssemblyLoader assemblyLoader)
       at Telerik.OpenAccess.Sdk.Enhancer.EnhancerBase.CrossDomainRun()
  2. Serge
    Serge avatar
    375 posts

    Posted 22 May 2012 Link to this post

    Hello Bob, 

     I have been trying to reproduce this exception but I haven't been able to. Can you please send us your mapping project, so that I can debug it locally. 

    I am looking forward to resolving this issue. 
    the Telerik team
    Follow @OpenAccessORM Twitter channel to be the first one to get the latest updates on new releases, tips and tricks and sneak peeks at our product labs!
  3. Omair Shakeel
    Omair Shakeel avatar
    1 posts
    Member since:
    Dec 2009

    Posted 08 Oct 2015 in reply to Serge Link to this post



    I am getting this same exception after updating to Fluent model. DId you figure out the reason why this could happen and how to avoid it? 



  4. Viktor Zhivkov
    Viktor Zhivkov avatar
    324 posts

    Posted 12 Oct 2015 Link to this post

    Hi Omair,

    Exceptions like the one below may indicate mis-configured Fluent mapping for one of the sides of an association (most probably a Many-to-Many one) or a property of array, list, collection or dictionary of primitive type (e.g public string[] Tags { get; set;}).
    Please review your code if it complies with the documentation guidelines: I would like to suggest to you to open separate forum thread describing the issue you are experiencing as this thread is pretty old and we have difficulties identifying the correct version that you are using (compared to the one of the original poster).

    Viktor Zhivkov
    Check out the latest announcement about Telerik Data Access vNext as a powerful framework able to solve core development problems.
Back to Top