Debug / Relase in Visual studio and missing embeded files
Debug / Relase in Visual studio and missing embeded files
I have a EFmodels class library project that targets .net47. In it is a EF6.edml file that can be edited with Entity Developer.
This works perfect in Debug mode but if you put the Project into release mode it no longer will embed the csdl, ssdl and msl files.
You can verify that the EFModels.dll in the debug folder is over 200kb larger than the one in the release folder.
Is this something that can be specified with Entity Developer? Or something I can change in visual studio?
This works perfect in Debug mode but if you put the Project into release mode it no longer will embed the csdl, ssdl and msl files.
You can verify that the EFModels.dll in the debug folder is over 200kb larger than the one in the release folder.
Is this something that can be specified with Entity Developer? Or something I can change in visual studio?
Re: Debug / Relase in Visual studio and missing embeded files
Why did you decide so? Are you getting any error? If so, specify the exact text of the error and its full stack trace. Also please use some decompiler (e.g.: JustDecompile) and check if the resources *.csdl, *.msl, *.ssdl are embedded to the result assembly in Release Mode.KW wrote:This works perfect in Debug mode but if you put the Project into release mode it no longer will embed the csdl, ssdl and msl files.
The size difference is designed: https://stackoverflow.com/questions/533 ... tudio-2010.KW wrote:You can verify that the EFModels.dll in the debug folder is over 200kb larger than the one in the release folder.
Re: Debug / Relase in Visual studio and missing embeded files
Code: Select all
Unable to load the specified metadata resource.
at System.Data.Entity.Core.Metadata.Edm.MetadataArtifactLoaderResource.LoadResource()
at System.Data.Entity.Core.Metadata.Edm.MetadataArtifactLoaderResource.CreateReader()
at System.Data.Entity.Core.Metadata.Edm.MetadataArtifactLoaderResource.CreateReaders(DataSpace spaceToGet)
at System.Data.Entity.Core.Metadata.Edm.MetadataArtifactLoaderComposite.CreateReaders(DataSpace spaceToGet)
at System.Data.Entity.Core.Metadata.Edm.MetadataCache.LoadEdmItemCollection(MetadataArtifactLoader loader)
at System.Data.Entity.Core.Metadata.Edm.MetadataCache.<>c__DisplayClass5.<GetMetadataWorkspace>b__0(String k)
at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory)
at System.Data.Entity.Core.Metadata.Edm.MetadataCache.GetMetadataWorkspace(String cacheKey, MetadataArtifactLoader artifactLoader)
at System.Data.Entity.Core.Metadata.Edm.MetadataCache.GetMetadataWorkspace(DbConnectionOptions effectiveConnectionOptions)
at System.Data.Entity.Core.EntityClient.EntityConnection.GetMetadataWorkspace()
at System.Data.Entity.Core.Objects.ObjectContext.RetrieveMetadataWorkspaceFromConnection()
at System.Data.Entity.Core.Objects.ObjectContext..ctor(EntityConnection connection, Boolean isConnectionConstructor, ObjectQueryExecutionPlanFactory objectQueryExecutionPlanFactory, Translator translator, ColumnMapFactory columnMapFactory)
at System.Data.Entity.Internal.InternalConnection.CreateObjectContextFromConnectionModel()
at System.Data.Entity.Internal.LazyInternalConnection.CreateObjectContextFromConnectionModel()
at System.Data.Entity.Internal.LazyInternalContext.InitializeContext()
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.get_InternalContext()
at System.Data.Entity.Infrastructure.DbQuery`1.System.Linq.IQueryable.get_Provider()
at System.Linq.Queryable.Select[TSource,TResult](IQueryable`1 source, Expression`1 selector)
at MeridianCondoResortsWebAPI.v1.Controllers.HKController.GenerateCheckInOutSheet(DateTime Day)
at lambda_method(Closure , Object , Object[] )
at Microsoft.AspNetCore.Mvc.Internal.ObjectMethodExecutor.Execute(Object target, Object[] parameters)
at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.<InvokeActionMethodAsync>d__27.MoveNext()
The telerik decompiler has the following in the debug:
Project Creation:
============================
1.EF6.ssdl
2.EF6.csdl
3.EF6.msl
These files are NOT in the release build.
It's definitive - the release build is not publishing the embedded files.
Re: Debug / Relase in Visual studio and missing embeded files
We cannot reproduce the issue in our environment. Please specify:
1) the exact version (x.x.x) of your dotConnect for MySQL via Visual Studio > Tools > MySQL > About
2) the version and edition of your Visual Studio via Help > About
3) right click your project in Solution Explorer > Properties > the Build tab, send us a screenshot of settings in this window
1) the exact version (x.x.x) of your dotConnect for MySQL via Visual Studio > Tools > MySQL > About
2) the version and edition of your Visual Studio via Help > About
3) right click your project in Solution Explorer > Properties > the Build tab, send us a screenshot of settings in this window
Re: Debug / Relase in Visual studio and missing embeded files
We still cannot reproduce the problem. Please create a brand new simple console application, add the *.edml model with one table to it, compile in the Release mode. If the issue persists in this case as well, zip and upload this project (with a compiled binaries) to ftp://ftp.devart.com (credentials: anonymous / yourEmail).
Re: Debug / Relase in Visual studio and missing embeded files
I think I may have created a .net standard class library to host the entity framework model. Can you try that project type?
Re: Debug / Relase in Visual studio and missing embeded files
You created a .Net Core project, opened *.csproj and changed target framework to net461, added *.edml model (EF6), didn't you?
The ".NET Core with *.edml" scenario has two issues with a current build of dotConnect for MySQL:
1. "Custom Tool=DevartEfGenerator" (model property) doesn't generate any code. The bug with applying Custom Tool by Devart Entity Model (*.edml) in VS 2017 .NET Core projects is fixed in an upcoming new public build of dotConnect for MySQL. We will notify you when it is available for download.
2. "Build Action=DevartEntityDeploy" (model property) doesn't embed the resources (*.ssdl, *.msl, *.csdl) to the result assembly. We didn't find a way how to fix this issue. Also, we have checked a standard Microsoft EF Designer, it cannot embed resources as well. Similar problems:
https://github.com/dotnet/project-system/issues/2371
https://github.com/dotnet/project-system/issues/113
As a workaround, please use a fluent mapping, you can generate it with the DbContext template: http://blog.devart.com/entity-developer ... plate.html.
OR use .NET Framework project type with *.edml (EF6).
OR use .NET Core project type with *.efml (EF Core).
OR use .NET Framework project type with *.efml (EF Core).
The ".NET Core with *.edml" scenario has two issues with a current build of dotConnect for MySQL:
1. "Custom Tool=DevartEfGenerator" (model property) doesn't generate any code. The bug with applying Custom Tool by Devart Entity Model (*.edml) in VS 2017 .NET Core projects is fixed in an upcoming new public build of dotConnect for MySQL. We will notify you when it is available for download.
2. "Build Action=DevartEntityDeploy" (model property) doesn't embed the resources (*.ssdl, *.msl, *.csdl) to the result assembly. We didn't find a way how to fix this issue. Also, we have checked a standard Microsoft EF Designer, it cannot embed resources as well. Similar problems:
https://github.com/dotnet/project-system/issues/2371
https://github.com/dotnet/project-system/issues/113
As a workaround, please use a fluent mapping, you can generate it with the DbContext template: http://blog.devart.com/entity-developer ... plate.html.
OR use .NET Framework project type with *.edml (EF6).
OR use .NET Core project type with *.efml (EF Core).
OR use .NET Framework project type with *.efml (EF Core).
Re: Debug / Relase in Visual studio and missing embeded files
New build of dotConnect for MySQL 8.9.958 is available for download: viewtopic.php?f=2&t=35776.