.NET Entity Framework Error: Exception Details: System.InvalidOperationException: A circular reference was detected while serializing an object of type System.Data.Entity.DynamicProxies.Client

Jump to: navigation, search

.NET Entity Framework Error: Exception Details: System.InvalidOperationException: A circular reference was detected while serializing an object of type System.Data.Entity.DynamicProxies.Client You should be able to fix this problem by adding the three configuration lines as shown below DbContext dbContext = new DbContext(_connectionString); dbContext.Configuration.AutoDetectChangesEnabled = false; //added line dbContext.Configuration.LazyLoadingEnabled = false; //added line dbContext.Configuration.ProxyCreationEnabled = false; //added line var userInfo = from tbl in dbContext.Users where tbl.ID == myUserID select tbl;

See also

Personal tools
Namespaces
Variants
Views
Actions
Navigation