No Entity framework provider found?

Discussion of open issues, suggestions and bugs regarding Entity Framework support in ADO.NET Data providers
Post Reply
mcinnes01
Posts: 19
Joined: Wed 27 Jun 2012 13:55

No Entity framework provider found?

Post by mcinnes01 » Mon 11 Nov 2013 10:46

Hi,

I have just upgraded to dotConnect for Oracle 8.1.26.0, When I try to retrieve data I am getting the following error:
{"Schema specified is not valid. Errors: \r\nC21Context.DataModel1.ssdl(2,2) : error 0152: No Entity Framework provider found for the ADO.NET provider with invariant name 'Devart.Data.Oracle'. Make sure the provider is registered in the 'entityFramework' section of the application config file. See http://go.microsoft.com/fwlink/?LinkId=260882 for more information."}
This is my app config for a little test console app:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />

<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 --></configSections>
<connectionStrings>
<add name="DashSecurityConnection" connectionString="Data Source=server;Initial Catalog=DashSecurity;Persist Security Info=True;User ID=user;Password=password" providerName="System.Data.Sqlclient" />
<add name="CHRISCSEntitiesConnectionString" connectionString="metadata=res://Data/C21Context.DataModel1.csdl|res://Data/C21Context.DataModel1.ssdl|res://Data/C21Context.DataModel1.msl;provider=Devart.Data.Oracle;provider connection string="User Id=user;Password=password;Server=ipaddress;Direct=True;Sid=sid;Port=port;Persist Security Info=True"" providerName="System.Data.EntityClient" />
</connectionStrings>
<system.data>
<DbProviderFactories>
<remove invariant="Devart.Data.Oracle" />
<add name="dotConnect for Oracle" invariant="Devart.Data.Oracle" description="Devart dotConnect for Oracle" type="Devart.Data.Oracle.OracleProviderFactory, Devart.Data.Oracle, &#xA; Version=7.9.322.0, Culture=neutral, PublicKeyToken=09af7300eec23701" />
</DbProviderFactories>
</system.data>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" />
<providers>
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
</providers>
</entityFramework>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Telerik.Web.UI" publicKeyToken="121fae78165ba3d4" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2013.3.1015.45" newVersion="2013.3.1015.45" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="EntityFramework" publicKeyToken="b77a5c561934e089" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
Also having gone through these instructions: http://blog.devart.com/entity-framework ... force.html

I have edit my config as below:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</configSections>
<entityFramework>
<providers>
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
<provider invariantName="Devart.Data.Oracle" type="Devart.Data.Oracle.Entity.OracleEntityProviderServices, Devart.Data.Oracle.Entity, Version=8.1.26.0, Culture=neutral, PublicKeyToken=09af7300eec23701" >
<migrationSqlGenerator type="Devart.Data.Oracle.Entity.Migrations.OracleEntityMigrationSqlGenerator, Devart.Data.Oracle.Entity, Version=8.1.26.0, Culture=neutral, PublicKeyToken=09af7300eec23701" />
</provider>
</providers>
</entityFramework>
<system.data>
<DbProviderFactories>
<remove invariant="Devart.Data.Oracle" />
<add name="dotConnect for Oracle" invariant="Devart.Data.Oracle" description="Devart dotConnect for Oracle"
type="Devart.Data.Oracle.OracleProviderFactory, Devart.Data.Oracle, Version=8.1.26.0, Culture=neutral, PublicKeyToken=09af7300eec23701" />
</DbProviderFactories>
</system.data>

<connectionStrings>
<add name="DashSecurityConnection" connectionString="Data Source=server;Initial Catalog=DashSecurity;Persist Security Info=True;User ID=user;Password=password" providerName="System.Data.Sqlclient" />
<add name="CHRISCSEntitiesConnectionString" connectionString="metadata=res://Data/C21Context.DataModel1.csdl|res://Data/C21Context.DataModel1.ssdl|res://Data/C21Context.DataModel1.msl;provider=Devart.Data.Oracle;provider connection string="User Id=user;Password=password;Server=serverip;Direct=True;Sid=sid;Port=port;Persist Security Info=True"" providerName="System.Data.EntityClient" />
</connectionStrings>

<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>

<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Telerik.Web.UI" publicKeyToken="121fae78165ba3d4" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2013.3.1015.45" newVersion="2013.3.1015.45" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="EntityFramework" publicKeyToken="b77a5c561934e089" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
And this produces this error:
{"Unrecognized element 'migrationSqlGenerator'. (C:\\Users\\AMcInnes\\Documents\\Visual Studio 2012\\Projects\\Dash\\ConsoleApplication1\\bin\\Debug\\ConsoleApplication1.vshost.exe.Config line 10)"}
Any ideas?

Andy

Shalex
Site Admin
Posts: 8247
Joined: Thu 14 Aug 2008 12:44

Re: No Entity framework provider found?

Post by Shalex » Tue 12 Nov 2013 17:58

There is a bug with setting migrationSqlGenerator via *.config in Entity Framework 6. Please remove migrationSqlGenerator and leave only provider registration (and change 8.1.26.0 to 8.1.26.6):

Code: Select all

<entityFramework>
  <providers>
    <provider invariantName="Devart.Data.Oracle" type="Devart.Data.Oracle.Entity.OracleEntityProviderServices, Devart.Data.Oracle.Entity, Version=8.1.26.6, Culture=neutral, PublicKeyToken=09af7300eec23701" >
    </provider>
  </providers>
</entityFramework>
If you want to use EF Code-First Migrations, please set migrationSqlGenerator in the code: http://blogs.devart.com/dotconnect/enti ... Migrations.

We will update the article concerning usage of migrationSqlGenerator.

Post Reply