Hi,
I installed dotConnect for Postgresql Professional, trial version and when I want to create my edmx, I get this error: "Your project references the latest version of the Entity Framework; however, an Entity Framework data provide compatible with this version could not be found for your data connection. If you have already installed a compatable provider..."
I have installed EntityFramework 6.1.3 (the latest one) via nuget.
I have referenced these dll-s in my project: Devart.Data, Devart.Data.Postgresql, Devart.Data.Postgresql.Entity (6).
My App.config file looks like this:
<?xml version="1.0" encoding="utf-8"?>
<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=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</configSections>
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" />
<providers>
<provider invariantName="Devart.Data.PostgreSql" type="Devart.Data.PostgreSql.Entity.PgSqlEntityProviderServices, Devart.Data.PostgreSql.Entity, Version=7.6.763.0, Culture=neutral, PublicKeyToken=09af7300eec23701" />
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
</providers>
</entityFramework>
<system.data>
<DbProviderFactories>
<remove invariant="Devart.Data.PostgreSql" />
<add name="dotConnect for Postgresql" invariant="Devart.Data.PostgreSql" description="Devart dotConnect for Postgresql" type="Devart.Data.PostgreSql.PostgreSqlProviderFactory, Devart.Data.PostgreSql, Version=7.6.763.0, Culture=neutral, PublicKeyToken=09af7300eec23701" />
</DbProviderFactories>
</system.data>
</configuration>
I also modified Version=7.6.763.0 from <entity framework> with Version=7.6.763.6 after rebuilding app.
Could you, please help? Thanks.
EntityFramework database provider could not be found
Re: EntityFramework database provider could not be found
Starting from v7.5, there was EF assembly name change: viewtopic.php?f=3&t=33573 > the Entity Framework Assembly Name Change section.
Please replace
with
Please replace
Code: Select all
<entityFramework>
<providers>
<provider invariantName="Devart.Data.PostgreSql" type="Devart.Data.PostgreSql.Entity.PgSqlEntityProviderServices, Devart.Data.PostgreSql.Entity, Version=7.6.763.0, Culture=neutral, PublicKeyToken=09af7300eec23701" />
</providers>
</entityFramework>
Code: Select all
<entityFramework>
<providers>
<provider invariantName="Devart.Data.PostgreSql" type="Devart.Data.PostgreSql.Entity.PgSqlEntityProviderServices, Devart.Data.PostgreSql.Entity.EF6, Version=7.6.763.0, Culture=neutral, PublicKeyToken=09af7300eec23701" />
</providers>
</entityFramework>
Re: EntityFramework database provider could not be found
Thanks a lot, it worked. But after creating the edmx I get this error:
In the edmx file I can see all the tables from the database, but the generated .cs file for the edmx says: ErrorGeneratingOutput
No classes were generated for my tables.
Code: Select all
Error 5 An Exception was thrown while running the transformation code. The process cannot continue. The following Exception was thrown:
System.BadImageFormatException: Could not load file or assembly 'Microsoft.VisualStudio.TextTemplating.VSHost.12.0.dll' or one of its dependencies.
An attempt was made to load a program with an incorrect format.
File name: 'Microsoft.VisualStudio.TextTemplating.VSHost.12.0.dll'
at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.LoadWithPartialNameHack(String partialName, Boolean cropPublicKey)
at Microsoft.VisualStudio.TextTemplating.TransformationRunner.PrepareTransformation(TemplateProcessingSession session, String source, ITextTemplatingEngineHost host)
at Microsoft.VisualStudio.TextTemplating.Engine.CompileAndPrepareRun(String generatorCode, ITextTemplatingEngineHost host, TemplateProcessingSession session, IDebugTransformationRunFactory runFactory)
C:\Proiecte\mille doctconnect\trunk\MillefioriProd.Data\ModelMillefioriProd.tt 0 0 MillefioriProd.Data
No classes were generated for my tables.
Re: EntityFramework database provider could not be found
Actually there are two errors. The first one is:
Code: Select all
Error 12 There was a problem loading the assembly 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Microsoft.VisualStudio.TextTemplating.VSHost.12.0\v4.0_12.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.TextTemplating.VSHost.12.0.dll' The following Exception was thrown:
System.BadImageFormatException: Could not load file or assembly 'file:///C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Microsoft.VisualStudio.TextTemplating.VSHost.12.0\v4.0_12.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.TextTemplating.VSHost.12.0.dll' or one of its dependencies. The module was expected to contain an assembly manifest.
File name: 'file:///C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Microsoft.VisualStudio.TextTemplating.VSHost.12.0\v4.0_12.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.TextTemplating.VSHost.12.0.dll'
at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.InternalLoadFrom(String assemblyFile, Evidence securityEvidence, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm, Boolean forIntrospection, Boolean suppressSecurityChecks, StackCrawlMark& stackMark)
at System.Reflection.Assembly.LoadFrom(String assemblyFile)
at Microsoft.VisualStudio.TextTemplating.TransformationRunner.AttemptAssemblyLoad(String assemblyName)
WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog]
Re: EntityFramework database provider could not be found
These errors are not related to dotConnect for PostgreSQL.
As a workaround, we recommend you to use Entity Developer (Devart Entity Model, *.edml) instead of EDM Designer (ADO.NET Entity Data Model, *.edmx). It is adjusted for working with PostgreSQL and has an advanced functionality: http://www.devart.com/entitydeveloper/ed-vs-edm.html. Additionally, Entity Developer adds registration of EF6 provider in app.config automatically.
As a workaround, we recommend you to use Entity Developer (Devart Entity Model, *.edml) instead of EDM Designer (ADO.NET Entity Data Model, *.edmx). It is adjusted for working with PostgreSQL and has an advanced functionality: http://www.devart.com/entitydeveloper/ed-vs-edm.html. Additionally, Entity Developer adds registration of EF6 provider in app.config automatically.