This is a migrated thread and some comments may be shown as answers.

Value cannot be null. Parameter name: persistentType

3 Answers 140 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Bob
Top achievements
Rank 1
Bob asked on 20 May 2012, 12:49 PM
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
ExceptionString:
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()

3 Answers, 1 is accepted

Sort by
0
Serge
Telerik team
answered on 22 May 2012, 05:18 PM
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. 
 
Greetings,
Serge
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!
0
Omair Shakeel
Top achievements
Rank 1
answered on 08 Oct 2015, 11:21 AM

Hi

 

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? 

 

Thanks

0
Viktor Zhivkov
Telerik team
answered on 12 Oct 2015, 01:28 PM
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).

Regards,
Viktor Zhivkov
Telerik
 
Check out the latest announcement about Telerik Data Access vNext as a powerful framework able to solve core development problems.
Tags
General Discussions
Asked by
Bob
Top achievements
Rank 1
Answers by
Serge
Telerik team
Omair Shakeel
Top achievements
Rank 1
Viktor Zhivkov
Telerik team
Share this question
or