Home c# Configuration system failed to initialize

Configuration system failed to initialize

Author

Date

Category

Good day!

I am writing a program using EF6 + MySQL. After starting, when executing the program, it gives the following effect:

Configuration system failed to initialize --- & gt; System.Configuration.ConfigurationErrorsException: Unknown entityFramework configuration section.

Actually, my App.Config:

& lt;? xml version = "1.0" encoding = "utf-8"? & gt;
& lt; configuration & gt;
 & lt; configSections & gt;
    & lt;! - For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 - & gt;
  & lt; / configSections & gt;
  & lt; connectionStrings & gt;
    & lt; add name = "DeveloperConnection"
       providerName = "MySql.Data.MySqlClient"
       connectionString = "server = localhost; UserId = root; Password =; database = mobiledb; CharSet = utf8; Persist Security Info = True" / & gt;
  & lt; / connectionStrings & gt;
  & lt; entityFramework & gt;
    & lt; providers & gt;
     & lt; provider invariantName = "MySql.Data.MySqlClient" type = "MySql.Data.MySqlClient.MySqlProviderServices, MySql.Data.Entity.EF6, Version = 7.0.7.0, Culture = neutral, PublicKeyToken = c569clClient;
    & lt; provider invariantName = "MySql.Data.MySqlClient" type = "MySql.Data.MySqlClient.MySqlProviderServices, MySql.Data.Entity.EF6, Version = 6.10.8.0, Culture = neutral, PublicKeyToken = c569c687fc44
   & lt; / provider & gt; & lt; / providers & gt;
  & lt; / entityFramework & gt;
& lt; / configuration & gt;

I can’t understand CHYDNT?


Answer 1, authority 100%

I asked myself – I answered myself. It is necessary, as tym32167 already said, to add an entityFramework section to configSections:

& lt; configSections & gt;
    & lt;! - For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 - & gt;
   & lt; section name = "entityFramework" type = "System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version = 6.0.0.0, Culture = neutral, PublicKeyToken = b77a5c561934e089" requirePermission = "false" / & gt;
  & lt; / configSections & gt;

Programmers, Start Your Engines!

Why spend time searching for the correct question and then entering your answer when you can find it in a second? That's what CompuTicket is all about! Here you'll find thousands of questions and answers from hundreds of computer languages.

Recent questions