Нераспознанный раздел конфигурации entityFramework

<?xml version = "1.0" encoding = "utf-8"?>
<configuration>
  <configSections>
    <sectionGroup name = "dotNetOpenAuth" type = "DotNetOpenAuth.Configuration.DotNetOpenAuthSection, DotNetOpenAuth.Core">
      <section name = "messaging" type = "DotNetOpenAuth.Configuration.MessagingElement, DotNetOpenAuth.Core" requirePermission = "false" allowLocation = "true" />
      <section name = "reporting" type = "DotNetOpenAuth.Configuration.ReportingElement, DotNetOpenAuth.Core" requirePermission = "false" allowLocation = "true" />
      <section name = "oauth" type = "DotNetOpenAuth.Configuration.OAuthElement, DotNetOpenAuth.OAuth" requirePermission = "false" allowLocation = "true" />
      <section name = "openid" type = "DotNetOpenAuth.Configuration.OpenIdElement, DotNetOpenAuth.OpenId" requirePermission = "false" allowLocation = "true" />
    </sectionGroup>
  </configSections>

   <!--For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 </configSections>
  <configuration>
    <configSections>
        <section name = "quartz" type = "System.Configuration.NameValueSectionHandler, System, Version=1.0.5000.0,Culture=neutral, PublicKeyToken=b77a5c561934e089" />
            <section name = "log4net" type = "log4net.Config.Log4NetConfigurationSectionHandler, log4net" />
        <sectionGroup name = "common">
            <section name = "logging" type = "Common.Logging.ConfigurationSectionHandler, Common.Logging" />
      <section name = "entityFramework" type = "System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission = "false" />
        </sectionGroup>
    </configSections>-->

  <system.web>
    <compilation debug = "true" targetFramework = "4.5">
      <assemblies>
        <add assembly = "System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
        <add assembly = "System.ComponentModel.DataAnnotations, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
      </assemblies>
    </compilation>
    <httpRuntime targetFramework = "4.5" />
  </system.web>
  <connectionStrings>
    <add name = "StarterSite" connectionString = "Data Source=|DataDirectory|\StarterSite.sdf" providerName = "System.Data.SqlServerCe.4.0" />
  </connectionStrings>
  <runtime>
    <assemblyBinding xmlns = "urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name = "DotNetOpenAuth.Core" publicKeyToken = "2780ccd10d57b246" />
        <bindingRedirect oldVersion = "0.0.0.0-4.3.0.0" newVersion = "4.3.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name = "DotNetOpenAuth.AspNet" publicKeyToken = "2780ccd10d57b246" />
        <bindingRedirect oldVersion = "0.0.0.0-4.3.0.0" newVersion = "4.3.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name = "System.Web.Optimization" publicKeyToken = "31bf3856ad364e35" />
        <bindingRedirect oldVersion = "1.0.0.0-1.1.0.0" newVersion = "1.1.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name = "WebGrease" publicKeyToken = "31bf3856ad364e35" />
        <bindingRedirect oldVersion = "0.0.0.0-1.6.5135.21930" newVersion = "1.6.5135.21930" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name = "System.Web.Helpers" publicKeyToken = "31bf3856ad364e35" />
        <bindingRedirect oldVersion = "1.0.0.0-3.0.0.0" newVersion = "3.0.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name = "System.Web.WebPages" publicKeyToken = "31bf3856ad364e35" />
        <bindingRedirect oldVersion = "1.0.0.0-3.0.0.0" newVersion = "3.0.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name = "MySql.Data" publicKeyToken = "c5687fc88969c44d" culture = "neutral" />
        <bindingRedirect oldVersion = "0.0.0.0-6.8.8.0" newVersion = "6.8.8.0" />
      </dependentAssembly>
    </assemblyBinding>
    <!-- This prevents the Windows Event Log from frequently logging that HMAC1 is being used (when the other party needs it). -->
    <legacyHMACWarning enabled = "0" />
    <!-- When targeting ASP.NET MVC 3, this assemblyBinding makes MVC 1 and 2 references relink
         to MVC 3 so libraries such as DotNetOpenAuth that compile against MVC 1 will work with it.
    <assemblyBinding xmlns = "urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name = "System.Web.Mvc" publicKeyToken = "31bf3856ad364e35" />
        <bindingRedirect oldVersion = "1.0.0.0-3.0.0.0" newVersion = "3.0.0.0" />
      </dependentAssembly>
    </assemblyBinding>
     -->
  </runtime>
  <system.data>
    <DbProviderFactories>
      <remove invariant = "System.Data.SqlServerCe.4.0" />
      <add name = "Microsoft SQL Server Compact Data Provider 4.0" invariant = "System.Data.SqlServerCe.4.0" description = ".NET Framework Data Provider for Microsoft SQL Server Compact" type = "System.Data.SqlServerCe.SqlCeProviderFactory, System.Data.SqlServerCe, Version=4.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" />
    <remove invariant = "MySql.Data.MySqlClient" /><add name = "MySQL Data Provider" invariant = "MySql.Data.MySqlClient" description = ".Net Framework Data Provider for MySQL" type = "MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=6.8.8.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" /></DbProviderFactories>
  </system.data>
  <system.net>
    <defaultProxy enabled = "true" />
    <settings>
      <!-- This setting causes .NET to check certificate revocation lists (CRL) 
           before trusting HTTPS certificates.  But this setting tends to not 
           be allowed in shared hosting environments. -->
      <!--<servicePointManager checkCertificateRevocationList = "true"/>-->
    </settings>
  </system.net>
  <dotNetOpenAuth>
    <messaging>
      <untrustedWebRequest>
        <whitelistHosts>
          <!-- Uncomment to enable communication with localhost (should generally not activate in production!) -->
          <!--<add name = "localhost" />-->
        </whitelistHosts>
      </untrustedWebRequest>
    </messaging>
    <!-- Allow DotNetOpenAuth to publish usage statistics to library authors to improve the library. -->
    <reporting enabled = "true" />
    <!-- This is an optional configuration section where aspects of dotnetopenauth can be customized. -->
    <!-- For a complete set of configuration options see http://www.dotnetopenauth.net/developers/code-snippets/configuration-options/ -->
    <openid>
      <relyingParty>
        <security requireSsl = "false">
          <!-- Uncomment the trustedProviders tag if your relying party should only accept positive assertions from a closed set of OpenID Providers. -->
          <!--<trustedProviders rejectAssertionsFromUntrustedProviders = "true">
            <add endpoint = "https://www.google.com/accounts/o8/ud" />
          </trustedProviders>-->
        </security>
        <behaviors>
          <!-- The following OPTIONAL behavior allows RPs to use SREG only, but be compatible
               with OPs that use Attribute Exchange (in various formats). -->
          <add type = "DotNetOpenAuth.OpenId.RelyingParty.Behaviors.AXFetchAsSregTransform, DotNetOpenAuth.OpenId.RelyingParty" />
        </behaviors>
      </relyingParty>
    </openid>
  </dotNetOpenAuth>
  <uri>
    <!-- The uri section is necessary to turn on .NET 3.5 support for IDN (international domain names),
         which is necessary for OpenID urls with unicode characters in the domain/host name.
         It is also required to put the Uri class into RFC 3986 escaping mode, which OpenID and OAuth require. -->
    <idn enabled = "All" />
    <iriParsing enabled = "true" />
  </uri>
  <system.codedom>
    <compilers>
      <compiler language = "c#;cs;csharp" extension = ".cs" type = "Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.8.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel = "4" compilerOptions = "/langversion:6 /nowarn:1659;1699;1701" />
      <compiler language = "vb;vbs;visualbasic;vbscript" extension = ".vb" type = "Microsoft.CodeDom.Providers.DotNetCompilerPlatform.VBCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.8.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel = "4" compilerOptions = "/langversion:14 /nowarn:41008 /define:_MYTYPE=\&quot;Web\&quot; /optionInfer+" />
    </compilers>
  </system.codedom>
  <entityFramework>
    <providers>
      <provider invariantName = "MySql.Data.MySqlClient" type = "MySql.Data.MySqlClient.MySqlProviderServices, MySql.Data.Entity.EF6, Version=6.2.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
    </providers>
  </entityFramework>
</configuration>

Я создал проект веб-страниц ASP.NET, а точнее Razor V3, и после первой сборки появилась следующая ошибка

Unrecognized configuration section entity Framework" \Web.config.I have tried installing Data.Entity from the nugget manager but it did not work.
(Severity Code Description Project File Line Suppression State Error
Unrecognized configuration section entityFramework.
C:\Users\HP\source\repos\VisitoMgtApp\VisitoMgtApp\Web.config 135

). Пожалуйста, помогите мне

ваше определение раздела конфигурации для EF закомментировано.

Maess 24.05.2018 18:56
Стоит ли изучать PHP в 2026-2027 годах?
Стоит ли изучать PHP в 2026-2027 годах?
Привет всем, сегодня я хочу высказать свои соображения по поводу вопроса, который я уже много раз получал в своем сообществе: "Стоит ли изучать PHP в...
Поведение ключевого слова "this" в стрелочной функции в сравнении с нормальной функцией
Поведение ключевого слова "this" в стрелочной функции в сравнении с нормальной функцией
В JavaScript одним из самых запутанных понятий является поведение ключевого слова "this" в стрелочной и обычной функциях.
Приемы CSS-макетирования - floats и Flexbox
Приемы CSS-макетирования - floats и Flexbox
Здравствуйте, друзья-студенты! Готовы совершенствовать свои навыки веб-дизайна? Сегодня в нашем путешествии мы рассмотрим приемы CSS-верстки - в...
Тестирование функциональных ngrx-эффектов в Angular 16 с помощью Jest
В системе управления состояниями ngrx, совместимой с Angular 16, появились функциональные эффекты. Это здорово и делает код определенно легче для...
Концепция локализации и ее применение в приложениях React ⚡️
Концепция локализации и ее применение в приложениях React ⚡️
Локализация - это процесс адаптации приложения к различным языкам и культурным требованиям. Это позволяет пользователям получить опыт, соответствующий...
Пользовательский скаляр GraphQL
Пользовательский скаляр GraphQL
Листовые узлы системы типов GraphQL называются скалярами. Достигнув скалярного типа, невозможно спуститься дальше по иерархии типов. Скалярный тип...
1
1
4 807
1
Перейти к ответу Данный вопрос помечен как решенный

Ответы 1

Ответ принят как подходящий

Вам нужно переместить закомментированное определение раздела конфигурации entity framework в существующий элемент конфигурационных разделов следующим образом:

<?xml version = "1.0" encoding = "utf-8"?>
<configuration>
  <configSections>
    <!--This is your EF section definition that was added-->
    <section name = "entityFramework" type = "System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission = "false" />
    <sectionGroup name = "dotNetOpenAuth" type = "DotNetOpenAuth.Configuration.DotNetOpenAuthSection, DotNetOpenAuth.Core">
      <section name = "messaging" type = "DotNetOpenAuth.Configuration.MessagingElement, DotNetOpenAuth.Core" requirePermission = "false" allowLocation = "true" />
      <section name = "reporting" type = "DotNetOpenAuth.Configuration.ReportingElement, DotNetOpenAuth.Core" requirePermission = "false" allowLocation = "true" />
      <section name = "oauth" type = "DotNetOpenAuth.Configuration.OAuthElement, DotNetOpenAuth.OAuth" requirePermission = "false" allowLocation = "true" />
      <section name = "openid" type = "DotNetOpenAuth.Configuration.OpenIdElement, DotNetOpenAuth.OpenId" requirePermission = "false" allowLocation = "true" />
    </sectionGroup>
  </configSections>

   <!--For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 </configSections>
  <configuration>
    <configSections>
        <section name = "quartz" type = "System.Configuration.NameValueSectionHandler, System, Version=1.0.5000.0,Culture=neutral, PublicKeyToken=b77a5c561934e089" />
            <section name = "log4net" type = "log4net.Config.Log4NetConfigurationSectionHandler, log4net" />
        <sectionGroup name = "common">
            <section name = "logging" type = "Common.Logging.ConfigurationSectionHandler, Common.Logging" />
      <section name = "entityFramework" type = "System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission = "false" />
        </sectionGroup>
    </configSections>-->

  <system.web>
    <compilation debug = "true" targetFramework = "4.5">
      <assemblies>
        <add assembly = "System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
        <add assembly = "System.ComponentModel.DataAnnotations, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
      </assemblies>
    </compilation>
    <httpRuntime targetFramework = "4.5" />
  </system.web>
  <connectionStrings>
    <add name = "StarterSite" connectionString = "Data Source=|DataDirectory|\StarterSite.sdf" providerName = "System.Data.SqlServerCe.4.0" />
  </connectionStrings>
  <runtime>
    <assemblyBinding xmlns = "urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name = "DotNetOpenAuth.Core" publicKeyToken = "2780ccd10d57b246" />
        <bindingRedirect oldVersion = "0.0.0.0-4.3.0.0" newVersion = "4.3.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name = "DotNetOpenAuth.AspNet" publicKeyToken = "2780ccd10d57b246" />
        <bindingRedirect oldVersion = "0.0.0.0-4.3.0.0" newVersion = "4.3.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name = "System.Web.Optimization" publicKeyToken = "31bf3856ad364e35" />
        <bindingRedirect oldVersion = "1.0.0.0-1.1.0.0" newVersion = "1.1.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name = "WebGrease" publicKeyToken = "31bf3856ad364e35" />
        <bindingRedirect oldVersion = "0.0.0.0-1.6.5135.21930" newVersion = "1.6.5135.21930" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name = "System.Web.Helpers" publicKeyToken = "31bf3856ad364e35" />
        <bindingRedirect oldVersion = "1.0.0.0-3.0.0.0" newVersion = "3.0.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name = "System.Web.WebPages" publicKeyToken = "31bf3856ad364e35" />
        <bindingRedirect oldVersion = "1.0.0.0-3.0.0.0" newVersion = "3.0.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name = "MySql.Data" publicKeyToken = "c5687fc88969c44d" culture = "neutral" />
        <bindingRedirect oldVersion = "0.0.0.0-6.8.8.0" newVersion = "6.8.8.0" />
      </dependentAssembly>
    </assemblyBinding>
    <!-- This prevents the Windows Event Log from frequently logging that HMAC1 is being used (when the other party needs it). -->
    <legacyHMACWarning enabled = "0" />
    <!-- When targeting ASP.NET MVC 3, this assemblyBinding makes MVC 1 and 2 references relink
         to MVC 3 so libraries such as DotNetOpenAuth that compile against MVC 1 will work with it.
    <assemblyBinding xmlns = "urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name = "System.Web.Mvc" publicKeyToken = "31bf3856ad364e35" />
        <bindingRedirect oldVersion = "1.0.0.0-3.0.0.0" newVersion = "3.0.0.0" />
      </dependentAssembly>
    </assemblyBinding>
     -->
  </runtime>
  <system.data>
    <DbProviderFactories>
      <remove invariant = "System.Data.SqlServerCe.4.0" />
      <add name = "Microsoft SQL Server Compact Data Provider 4.0" invariant = "System.Data.SqlServerCe.4.0" description = ".NET Framework Data Provider for Microsoft SQL Server Compact" type = "System.Data.SqlServerCe.SqlCeProviderFactory, System.Data.SqlServerCe, Version=4.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" />
    <remove invariant = "MySql.Data.MySqlClient" /><add name = "MySQL Data Provider" invariant = "MySql.Data.MySqlClient" description = ".Net Framework Data Provider for MySQL" type = "MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=6.8.8.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" /></DbProviderFactories>
  </system.data>
  <system.net>
    <defaultProxy enabled = "true" />
    <settings>
      <!-- This setting causes .NET to check certificate revocation lists (CRL) 
           before trusting HTTPS certificates.  But this setting tends to not 
           be allowed in shared hosting environments. -->
      <!--<servicePointManager checkCertificateRevocationList = "true"/>-->
    </settings>
  </system.net>
  <dotNetOpenAuth>
    <messaging>
      <untrustedWebRequest>
        <whitelistHosts>
          <!-- Uncomment to enable communication with localhost (should generally not activate in production!) -->
          <!--<add name = "localhost" />-->
        </whitelistHosts>
      </untrustedWebRequest>
    </messaging>
    <!-- Allow DotNetOpenAuth to publish usage statistics to library authors to improve the library. -->
    <reporting enabled = "true" />
    <!-- This is an optional configuration section where aspects of dotnetopenauth can be customized. -->
    <!-- For a complete set of configuration options see http://www.dotnetopenauth.net/developers/code-snippets/configuration-options/ -->
    <openid>
      <relyingParty>
        <security requireSsl = "false">
          <!-- Uncomment the trustedProviders tag if your relying party should only accept positive assertions from a closed set of OpenID Providers. -->
          <!--<trustedProviders rejectAssertionsFromUntrustedProviders = "true">
            <add endpoint = "https://www.google.com/accounts/o8/ud" />
          </trustedProviders>-->
        </security>
        <behaviors>
          <!-- The following OPTIONAL behavior allows RPs to use SREG only, but be compatible
               with OPs that use Attribute Exchange (in various formats). -->
          <add type = "DotNetOpenAuth.OpenId.RelyingParty.Behaviors.AXFetchAsSregTransform, DotNetOpenAuth.OpenId.RelyingParty" />
        </behaviors>
      </relyingParty>
    </openid>
  </dotNetOpenAuth>
  <uri>
    <!-- The uri section is necessary to turn on .NET 3.5 support for IDN (international domain names),
         which is necessary for OpenID urls with unicode characters in the domain/host name.
         It is also required to put the Uri class into RFC 3986 escaping mode, which OpenID and OAuth require. -->
    <idn enabled = "All" />
    <iriParsing enabled = "true" />
  </uri>
  <system.codedom>
    <compilers>
      <compiler language = "c#;cs;csharp" extension = ".cs" type = "Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.8.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel = "4" compilerOptions = "/langversion:6 /nowarn:1659;1699;1701" />
      <compiler language = "vb;vbs;visualbasic;vbscript" extension = ".vb" type = "Microsoft.CodeDom.Providers.DotNetCompilerPlatform.VBCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.8.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel = "4" compilerOptions = "/langversion:14 /nowarn:41008 /define:_MYTYPE=\&quot;Web\&quot; /optionInfer+" />
    </compilers>
  </system.codedom>
  <entityFramework>
    <providers>
      <provider invariantName = "MySql.Data.MySqlClient" type = "MySql.Data.MySqlClient.MySqlProviderServices, MySql.Data.Entity.EF6, Version=6.2.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
    </providers>
  </entityFramework>
</configuration>

Большое спасибо за ваш ответ

Chidi 25.05.2018 11:16

Ошибки, которые у меня сейчас есть; 1. Файл конфигурации web.config не имеет корневого тега <configuration>. 2. XML-документ не может содержать несколько элементов корневого уровня. 3. Элемент «пакеты» не объявлен. 4. Элемент dotNetOpenAuth не объявлен.

Chidi 25.05.2018 11:23

Я обновил свой ответ, включив в него полный код. Из вашего описания вы могли случайно удалить элемент <configuration>. Чтобы исправить это, сделайте резервную копию существующего файла конфигурации, откройте файл конфигурации, удалите все содержимое в файле конфигурации, скопируйте и вставьте мой ответ в файл конфигурации. Сохраните и снова запустите ваше приложение.

bman7716 25.05.2018 13:35

Я очень ценю вашу помощь.

Chidi 25.05.2018 16:32

Ошибка исчезла со следующей ошибкой: Код серьезности Описание Ошибка состояния подавления строки файла проекта Метод инициализации перед запуском приложения Start on type WebMatrix.WebData.PreApplicationStartCode вызвал исключение со следующим сообщением об ошибке: Не удалось загрузить файл или сборку MySql .ConnectorInstaller, Версия = 6.10.5.0, Культура = нейтральный, PublicKeyToken = c5687fc88969c44d 'или одна из его зависимостей. Система не может найти указанный файл. (C: \ Windows \ Microsoft.NET \ Framework \ v4.0.30319 \ Config \ machin‌ e.config, строка 266).

Chidi 25.05.2018 16:33

И эта вторая ошибка: элемент «пакеты» не объявлен. VisitoMgtApp C: \ Users \ HP \ source \ repos \ VisitoMgtApp‌ \ VisitoMgtApp \ packag‌ es.config 2

Chidi 25.05.2018 16:34

Другие вопросы по теме