Can't seem to get deployed EF code to work

Discussion of open issues, suggestions and bugs regarding Entity Framework support in ADO.NET Data providers
Post Reply
rmagruder
Posts: 47
Joined: Thu 26 Jun 2014 17:12

Can't seem to get deployed EF code to work

Post by rmagruder » Thu 06 Nov 2014 17:07

I need some help dotting i's and crossing t's.

My app runs fine on my development machine, but when properly licensed and deployed to the server using WebDeploy, I get this:

An Exception was thrown: The 'Instance' member of the Entity Framework provider type 'Devart.Data.Oracle.Entity.OracleEntityProviderServices, Devart.Data.Oracle.Entity, Version=8.4.201.0, Culture=neutral, PublicKeyToken=09af7300eec23701' did not return an object that inherits from 'System.Data.Entity.Core.Common.DbProviderServices'. Entity Framework providers must inherit from this class and the 'Instance' member must return the singleton instance of the provider. This may be because the provider does not support Entity Framework 6 or later; see http://go.microsoft.com/fwlink/?LinkId=260882 for more information.

So here's the info and things I verified on the server:
1. EntityFramework.dll version is 6.1.1
2. DevArt.Data.Oracle.dll and DevArt.Data.Oracle.Entity.Dll are both 8.4.201.0
3. DevArt.Data.dll is 5.0.993.0

In the web.config:

<configSections>
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
....
</configSections>

<connectionStrings>
<add name="ThreeDEntities2" connectionString="metadata=res://*/3DEntities.csdl|res://*/3DEntities.ssdl|res://*/3DEntities.msl;provider=Devart.Data.Oracle;provider connection string="User Id=XXXXXX;Password=XXXXX;Server=XXXXX;Direct=True;Sid=XXXXX;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, Version=8.4.201.0, Culture=neutral, PublicKeyToken=09af7300eec23701" />
</DbProviderFactories>
</system.data>
<entityFramework>
<providers>
<provider invariantName="Devart.Data.Oracle" type="Devart.Data.Oracle.Entity.OracleEntityProviderServices, Devart.Data.Oracle.Entity, Version=8.4.201.0, Culture=neutral, PublicKeyToken=09af7300eec23701" />
</providers>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
<parameters>
<parameter value="v11.0" />
</parameters>
</defaultConnectionFactory>
</entityFramework>

Where did I go wrong here?

rmagruder
Posts: 47
Joined: Thu 26 Jun 2014 17:12

Re: Can't seem to get deployed EF code to work

Post by rmagruder » Thu 06 Nov 2014 17:07

Also want to let you know I ensured the library I pulled for Entities was the one in the DevArt EF6 folder.

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

Re: Can't seem to get deployed EF code to work

Post by Shalex » Thu 06 Nov 2014 18:00

The revision number of provider in the entityFramework section should be *.6 (although it is *.0 in DbProviderFactories).

Post Reply