EF 6.3 + MSSQL CE (Edmx) in dotnet core 3.0 . Get error in config.
See original GitHub issueDescribe what is not working as expected. I tried run options EF 6.3 + MSSQL CE from dotnet core 3.0 - was not successful. No one idea more. Looks like error in app.config DbProviderFactories. In .Net Framework 4.8 – all work. But in dotnet core 3.0 –not work. I got idea from https://github.com/efcore/EdmxDotNetCoreSample/ But it didn’t help for me.
I added simple code https://github.com/parad74/dotnetcore_mssqlce 4.8/C4U.Model – project 4.8 Net Framework 4.8 C4U.Model.Include – Model for dotnet Core 3. Host – simple host-server dotnet Core 3. Test connection in public static void Main(string[] args) Help me, plz
Operating system: (e.g. Windows 7)
IDE: (e.g. Visual Studio 2019)
EF 6.3 + MSSQL CE from dotnet core 3.0
An error occurred while starting the application. ConfigurationErrorsException: Unrecognized configuration section system.data. (T:\Count4U\trunk\github\Count4U\host\bin\Debug\netcoreapp3.0\host.dll.config line 23) System.Configuration.ConfigurationSchemaErrors.ThrowIfErrors(bool ignoreLocal)
ConfigurationErrorsException: Configuration system failed to initialize System.Configuration.ClientConfigurationSystem.EnsureInit(string configKey)
TypeInitializationException: The type initializer for ‘System.Data.Entity.Internal.AppConfig’ threw an exception. System.Data.Entity.Internal.AppConfig.get_DefaultInstance()
TargetInvocationException: Exception has been thrown by the target of an invocation. System.RuntimeTypeHandle.CreateInstance(RuntimeType type, bool publicOnly, bool wrapExceptions, ref bool canBeCached, ref RuntimeMethodHandleInternal ctor, ref bool hasNoDefaultCtor)
ConfigurationErrorsException: Unrecognized configuration section system.data. (T:\Count4U\trunk\github\Count4U\host\bin\Debug\netcoreapp3.0\host.dll.config line 23) System.Configuration.ConfigurationSchemaErrors.ThrowIfErrors(bool ignoreLocal) System.Configuration.BaseConfigurationRecord.ThrowIfParseErrors(ConfigurationSchemaErrors schemaErrors) System.Configuration.BaseConfigurationRecord.ThrowIfInitErrors() System.Configuration.ClientConfigurationSystem.EnsureInit(string configKey)
Show raw exception details ConfigurationErrorsException: Configuration system failed to initialize System.Configuration.ClientConfigurationSystem.EnsureInit(string configKey) System.Configuration.ClientConfigurationSystem.PrepareClientConfigSystem(string sectionName) System.Configuration.ClientConfigurationSystem.System.Configuration.Internal.IInternalConfigSystem.GetSection(string sectionName) System.Configuration.ConfigurationManager.GetSection(string sectionName) System.Configuration.ConfigurationManager.get_ConnectionStrings() System.Data.Entity.Internal.AppConfig…ctor() System.Data.Entity.Internal.AppConfig…cctor()
Show raw exception details TypeInitializationException: The type initializer for ‘System.Data.Entity.Internal.AppConfig’ threw an exception. System.Data.Entity.Internal.AppConfig.get_DefaultInstance() System.Data.Entity.Infrastructure.DependencyResolution.InternalConfiguration…ctor(ResolverChain appConfigChain, ResolverChain normalResolverChain, RootDependencyResolver rootResolver, AppConfigDependencyResolver appConfigResolver, Func<DbDispatchers> dispatchers) System.Data.Entity.DbConfiguration…ctor()
Show raw exception details TargetInvocationException: Exception has been thrown by the target of an invocation. System.RuntimeTypeHandle.CreateInstance(RuntimeType type, bool publicOnly, bool wrapExceptions, ref bool canBeCached, ref RuntimeMethodHandleInternal ctor, ref bool hasNoDefaultCtor) System.RuntimeType.CreateInstanceDefaultCtorSlow(bool publicOnly, bool wrapExceptions, bool fillCache) System.RuntimeType.CreateInstanceDefaultCtor(bool publicOnly, bool skipCheckThis, bool fillCache, bool wrapExceptions) System.Activator.CreateInstance(Type type, bool nonPublic, bool wrapExceptions) System.Activator.CreateInstance(Type type, bool nonPublic) System.Data.Entity.Utilities.TypeExtensions.CreateInstance<T>(Type type, Func<string, Exception> exceptionFactory) System.Data.Entity.Utilities.TypeExtensions.CreateInstance<T>(Type type, Func<string, string, string> typeMessageFactory, Func<string, Exception> exceptionFactory) System.Data.Entity.Infrastructure.DependencyResolution.DbConfigurationManager.<.ctor>b__10_0() System.Lazy<T>.ViaFactory(LazyThreadSafetyMode mode) System.Lazy<T>.ExecutionAndPublication(LazyHelper executionAndPublication, bool useDefaultConstructor) System.Lazy<T>.CreateValue() System.Lazy<T>.get_Value() System.Data.Entity.Infrastructure.DependencyResolution.DbConfigurationManager.GetConfiguration() System.Data.Entity.Infrastructure.DependencyResolution.InternalConfiguration.get_Instance() System.Data.Entity.DbConfiguration.get_DependencyResolver() System.Data.Entity.Core.EntityClient.EntityConnection.ChangeConnectionString(string newConnectionString) System.Data.Entity.Core.EntityClient.EntityConnection…ctor(string connectionString) System.Data.Entity.Core.Objects.ObjectContext.CreateEntityConnection(string connectionString) System.Data.Entity.Core.Objects.ObjectContext…ctor(string connectionString) System.Data.Entity.Core.Objects.ObjectContext…ctor(string connectionString, string defaultContainerName) Count4U.Model.App_Data.MainDB…ctor(string connectionString) in Model6.cs + public MainDB(string connectionString) : base(connectionString, “MainDB”) host.Program.Main(string[] args) in Program.cs + using (Count4U.Model.App_Data.MainDB dc = new Count4U.Model.App_Data.MainDB(cs))
Issue Analytics
- State:
- Created 4 years ago
- Comments:14 (7 by maintainers)
@parad74 I have created an unofficial port of the SQL Compact provider to .NET Core: https://github.com/ErikEJ/EntityFramework6PowerTools/tree/community/src/ErikEJ.EntityFramework.SqlServerCompact
@ErikEJ Thanks a lot 😃