Bug 7546 - Mono 2.11.4, Entity Framework: Internal LazyIinternalConnection error
Summary: Mono 2.11.4, Entity Framework: Internal LazyIinternalConnection error
Status: RESOLVED INVALID
Alias: None
Product: Class Libraries
Classification: Mono
Component: System.Data ()
Version: unspecified
Hardware: PC All
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL: http://stackoverflow.com/questions/12...
Depends on:
Blocks:
 
Reported: 2012-09-29 09:26 UTC by Erwin Wolff
Modified: 2012-10-01 15:28 UTC (History)
3 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED INVALID

Description Erwin Wolff 2012-09-29 09:26:00 UTC
I am getting this error with a program that runs flawlessly on Microsoft't .NET:

Unhandled Exception:

System.TypeInitializationException: An exception was thrown by the type initializer for System.Data.Entity.ModelConfiguration.Utilities.TypeExtensions ---> System.InvalidProgramException: Invalid IL c
ode in System.Data.Metadata.Edm.PrimitiveType:GetEdmPrimitiveTypes (): method body is empty.

  at System.Data.Entity.ModelConfiguration.Utilities.TypeExtensions..cctor () [0x00000] in <filename unknown>:0
  --- End of inner exception stack trace ---
  at System.Data.Entity.Internal.DbSetDiscoveryService.GetSets () [0x00000] in <filename unknown>:0
  at System.Data.Entity.Internal.DbSetDiscoveryService.InitializeSets () [0x00000] in <filename unknown>:0
  at System.Data.Entity.DbContext.DiscoverAndInitializeSets () [0x00000] in <filename unknown>:0
  at System.Data.Entity.DbContext.InitializeLazyInternalContext (IInternalConnection internalConnection, System.Data.Entity.Infrastructure.DbCompiledModel model) [0x00000] in <filename unknown>:0
  at System.Data.Entity.DbContext..ctor (System.String nameOrConnectionString) [0x00000] in <filename unknown>:0
  at oldforum2vanille.NewForum.vforumEntities1..ctor () [0x00000] in <filename unknown>:0
  at oldforum2vanille.Program.ConvertDiscissionTopics (Int32 newforumid, System.String forumtitle) [0x00000] in <filename unknown>:0
  at oldforum2vanille.Program.Main (System.String[] args) [0x00000] in <filename unknown>:0
[ERROR] FATAL UNHANDLED EXCEPTION: System.TypeInitializationException: An exception was thrown by the type initializer for System.Data.Entity.ModelConfiguration.Utilities.TypeExtensions ---> System.In
validProgramException: Invalid IL code in System.Data.Metadata.Edm.PrimitiveType:GetEdmPrimitiveTypes (): method body is empty.

  at System.Data.Entity.ModelConfiguration.Utilities.TypeExtensions..cctor () [0x00000] in <filename unknown>:0
  --- End of inner exception stack trace ---
  at System.Data.Entity.Internal.DbSetDiscoveryService.GetSets () [0x00000] in <filename unknown>:0
  at System.Data.Entity.Internal.DbSetDiscoveryService.InitializeSets () [0x00000] in <filename unknown>:0
  at System.Data.Entity.DbContext.DiscoverAndInitializeSets () [0x00000] in <filename unknown>:0
  at System.Data.Entity.DbContext.InitializeLazyInternalContext (IInternalConnection internalConnection, System.Data.Entity.Infrastructure.DbCompiledModel model) [0x00000] in <filename unknown>:0
  at System.Data.Entity.DbContext..ctor (System.String nameOrConnectionString) [0x00000] in <filename unknown>:0
  at oldforum2vanille.NewForum.vforumEntities1..ctor () [0x00000] in <filename unknown>:0
  at oldforum2vanille.Program.ConvertDiscissionTopics (Int32 newforumid, System.String forumtitle) [0x00000] in <filename unknown>:0
  at oldforum2vanille.Program.Main (System.String[] args) [0x00000] in <filename unknown>:0

Steps to reproduce:
Make an application that uses an EDMX file generated by Entity Framework 5, using the MySql provider inside Visual Studio 2012.

Then, copy the EntityFramework.dll, the System.Data.Entity.dll, MySql.Data.dll and the MySql.Data.dll files to the folder from where the application is and run the application with Mono. The result should be the above exception.

The error is showed on both Linux and Windows. Not tested on Mac.
Comment 1 Erwin Wolff 2012-09-29 09:47:06 UTC
Mono JIT compiler version 2.11.4 (master/417ec78)
Copyright (C) 2002-2012 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
        TLS:           normal
        SIGSEGV:       normal
        Notification:  Thread + polling
        Architecture:  x86
        Disabled:      none
        Misc:          softdebug
        LLVM:          supported, not enabled.
        GC:            Included Boehm (with typed GC and Parallel Mark)
Comment 2 Zoltan Varga 2012-09-30 20:36:12 UTC
-> sys.data for now.
Comment 3 Marek Safar 2012-10-01 15:28:07 UTC
This is not scenario supported by Mono. You are not supposed to run Microsoft implementation specific runtime libraries like System.Data.Entity.dll with Mono.

Entity Framework has been open sourced recently (version 6.0) and it's bundled with the latest Mono version. Mono does not support earlier versions of Entity Framework.