Moved EDMX to sub-directory in separate assembly

Matthew Morgan

In VistaDB, I have a file named Forms.Forms.ssdl in the folder with the .vdb5 file.

When trying to execute a query, I get the following exception:

The entity type def_AttachType is not part of the model for the current context. at System.Data.Entity.Internal.InternalContext.UpdateEntitySetMappingsForType(Type entityType) at System.Data.Entity.Internal.InternalContext.GetEntitySetAndBaseTypeForType(Type entityType) at System.Data.Entity.Internal.Linq.InternalSet`1.Initialize() at System.Data.Entity.Internal.Linq.InternalSet`1.AsNoTracking() at System.Data.Entity.Infrastructure.DbQuery`1.AsNoTracking() at AJBoggs.SIS.Data.Forms.CachedFormsEntities.Refresh() in C:\GIT\lifia\sis\Data\Forms\CachedFormsEntities.cs:line 79 at AJBoggs.SIS.Data.Forms.CachedFormsEntities..ctor(IDbContextFactory dbContextFactory, ILogger logger) in C:\GIT\lifia\sis\Data\Forms\CachedFormsEntities.cs:line 63

I am using version

5.1.1.1418 of VistaDB.5.NET40.dll and VistaDB.5.Web.NET40.dll

5.1.0.1385 of VistaDB.5.Entity.6.NET40.dll

Are there any gotchas about namespaces or not having the EDMX in the root of the project?

Thanks!

1 Comment

M

Matthew Morgan

said
about 12 hours ago

I'm not sure what exactly fixed it but I got working with the following:

Put all three EDMX meta data files in the directory with the VistaDB databasemetadata=|DataDirectory|\Forms.Forms.csdl|||DataDirectory|\Forms.Forms.ssdl|||DataDirectory|\Forms.Forms.msl