Entity Framework и Mono: как решить проблему с «Could not load type 'System.Data.Entity.Internal.LazyInternalConnection'»?

Пытаюсь запустить приложение, использующее Entity Framework. Для тестов написал простое консольное приложение, которое читает все запси из одной таблицы в базе MySql. Тестовое приложение написано в Visual Studio 2012. На Windows это приложение отрабатывает нормально, но под Linux (Ubuntu Server 14.04) вываливается следующая ошибка:

Could not load signature of System.Data.Entity.Internal.InternalConnection:CreateObjectContextFromConnectionModel due to: Could not load file or assembly or one of its dependencies.
Could not load signature of System.Data.Entity.Internal.IInternalConnection:CreateObjectContextFromConnectionModel due to: Could not load file or assembly or one of its dependencies.

Unhandled Exception:
System.TypeLoadException: Could not load type 'System.Data.Entity.Internal.LazyInternalConnection' from assembly 'EntityFramework, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
  at Entity5Test.pepyakaEntities..ctor () [0x00000] in <filename unknown>:0
  at Entity5Test.Program.Main (System.String[] args) [0x00000] in <filename unknown>:0
[ERROR] FATAL UNHANDLED EXCEPTION: System.TypeLoadException: Could not load type 'System.Data.Entity.Internal.LazyInternalConnection' from assembly 'EntityFramework, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
  at Entity5Test.pepyakaEntities..ctor () [0x00000] in <filename unknown>:0
  at Entity5Test.Program.Main (System.String[] args) [0x00000] in <filename unknown>:0

Версия Mono:
Mono JIT compiler version 3.2.8 (Debian 3.2.8+dfsg-4ubuntu2)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
        TLS:           __thread
        SIGSEGV:       altstack
        Notifications: epoll
        Architecture:  x86
        Disabled:      none
        Misc:          softdebug
        LLVM:          supported, not enabled.
        GC:            sgen

App.config:
<configuration>
  <configSections>
    <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
    <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false"/>
  </configSections>
  <entityFramework>
    <defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
      <parameters>
        <parameter value="v11.0"/>
      </parameters>
    </defaultConnectionFactory>
  </entityFramework>
  <connectionStrings>
    <add name="Entities" connectionString="metadata=res://*/DataContext.csdl|res://*/DataContext.ssdl|res://*/DataContext.msl;provider=MySql.Data.MySqlClient;provider connection string=&quot;server=localhost;user id=***;password=***;database=***&quot;" providerName="System.Data.EntityClient"/>
  </connectionStrings>
  <startup>
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/>
  </startup>
</configuration>

Если что-то сталкивался с подобной проблемой, буду благодарен помощи в ее решении.
  • Вопрос задан
  • 3337 просмотров
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы