question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

EF 6.3 + MSSQL CE (Edmx) in dotnet core 3.0 . Get error in config.

See original GitHub issue

Describe 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:closed
  • Created 4 years ago
  • Comments:14 (7 by maintainers)

github_iconTop GitHub Comments

3reactions
ErikEJcommented, Oct 9, 2021
0reactions
parad74commented, Oct 24, 2021

@ErikEJ Thanks a lot 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Entity Framework 6.3 with ASP.NET Core 3
You can do this by using Entity Framework Core and Tools packages in your project. dotnet add package Microsoft.EntityFrameworkCore.SqlServer ...
Read more >
Using Microsoft.Data.SqlClient with Entity Framework 6
Want to use Microsoft.Data.SqlClient with Entity Framework 6 - this is now possible! This blog post describes the why and how.
Read more >
Announcing Entity Framework Core 3.0 and ...
We are extremely excited to announce the general availability of EF Core 3.0and EF 6.3 on nuget.org. The final versions of .NET Core...
Read more >
Entity Framework 6.3 and .NET Core 3 Support
NET Core 3 and opens a way to both migrate existing Entity Framework Classic applications and create new ones, using .NET Core 3...
Read more >
A Troubleshooting Guide for Entity Framework ...
The first step I would recommend is trying to determine what connection string the framework is using, because the exception doesn't tell you ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found