Can't get dotConnect working with EntityFramework

Discussion of open issues, suggestions and bugs regarding Entity Framework support in ADO.NET Data providers
Post Reply
bsuitt
Posts: 1
Joined: Tue 25 Nov 2014 20:32

Can't get dotConnect working with EntityFramework

Post by bsuitt » Tue 25 Nov 2014 20:51

I am currently evaluating using the DevArt dotConnect for Oracle provider to replace using the Oracle ODP.Net Data Provider for a series of applications.

I am using the latest version of Entity Framework (6.1.1) along with the latest trial version of DevArt dotConnect for Oracle (version 8.4.293). I am using code-first fluent mapping on an already existing database. Whenever I get to the point in my code where I am calling a query, I get the following error message:

An exception of type 'System.IO.FileLoadException' occurred in mscorlib.dll but was not handled in user code

Additional information: The given assembly name or codebase was invalid. (Exception from HRESULT: 0x80131047)

My application is an ASP.Net Web API with the following information in the web.config file:

Code: Select all

<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.4.293.6, Culture=neutral, PublicKeyToken=09af7300eec23701" />
    </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.4.293.0 Culture=neutral, PublicKeyToken=09af7300eec23701" />
    </DbProviderFactories>
  </system.data>
My database connection string is as follows (of course with actual credentials and server name stripped out):

Code: Select all

<add name="DataContext" connectionString="User ID=*******;Password=*******;Host=*****;Port=******;Pooling=true;Min Pool Size=1;Max Pool Size=10;" providerName="Devart.Data.Oracle" />
I am completely at a loss for why this isn't working. I was really hoping that this provider would alleviate a lot of the headaches that we've been having with the ODP.Net providers and Entity Framework. Does anyone have an idea of what the issue could be?

Thanks.

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

Re: Can't get dotConnect working with EntityFramework

Post by Shalex » Wed 26 Nov 2014 14:43

Please make sure that you added the references to the following assemblies in your project:
C:\Program Files (x86)\Devart\dotConnect\Oracle\Devart.Data.dll
C:\Program Files (x86)\Devart\dotConnect\Oracle\Devart.Data.Oracle.dll
C:\Program Files (x86)\Devart\dotConnect\Oracle\Entity\EF6\Devart.Data.Oracle.Entity.dll

If this doesn't help, specify the full call stack of the exception.

Post Reply