1 vote
Unhandled Exception: System.IO.FileLoadException: Mixed mode assembly is built against version 'v2.0.50727' of the runtime and cannot be loaded in the 4.0 runtime without additional configuration information.

Description

 
Hi.

When I use EdmGen2 with SQLite.NET v1.0.66.0 I get the exception below.

For example,
EdmGen2.exe /ModelGen "Data Source=C:\Working\MyApplication\MyDatabase.sqlite" "System.Data.SQLite" "MyDatabaseModel"

Unhandled Exception: System.IO.FileLoadException: Mixed mode assembly is built against version 'v2.0.50727' of the runtime and cannot be loaded in the 4.0 runtime without additional configuration information.
at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMarkHandle stackMark, Boolean loadTypeFromPartialName, ObjectHandleOnStack type)
at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark, Boolean loadTypeFromPartialName)
at System.Type.GetType(String typeName)
at System.Data.Common.DbProviderFactories.GetFactory(DataRow providerRow)
at System.Data.Entity.Design.EntityStoreSchemaGenerator.CreateStoreSchemaConnection(String providerInvariantName, String connectionString)
at System.Data.Entity.Design.SsdlGenerator.EntityStoreSchemaGeneratorDatabaseSchemaLoader..ctor(String providerInvariantName, String connectionString)
at System.Data.Entity.Design.EntityStoreSchemaGenerator..ctor(String providerInvariantName, String connectionString, String namespaceName)
at EdmGen2.EdmGen2.ModelGen(String connectionString, String provider, String modelName, Version version, Boolean includeForeignKeys) in C:\Working\Third Party\Microsoft\EdmGen2\1.0.20100420\EdmGen2\EdmGen2.cs:line 170
at EdmGen2.EdmGen2.ModelGen(String[] args) in C:\Working\Third Party\Microsoft\EdmGen2\1.0.20100420\EdmGen2\EdmGen2.cs:line 160
at EdmGen2.EdmGen2.Main(String[] args) in C:\Working\Third Party\Microsoft\EdmGen2\1.0.20100420\EdmGen2\EdmGen2.cs:line 57

The work-around is to edit "EdmGen2.exe.config" as follows:
<startup useLegacyV2RuntimeActivationPolicy="true">

I would like this change to be included in the source\download.

Thank you.

File Attachments


No files are attached


Comments

most recent at top (show oldest at top)


Updating...
Page view tracker