Cannot add or update entity model (edmx) with visual studio 2013 or 2015 & Entity Framework 6

Discussion of open issues, suggestions and bugs regarding Entity Framework support in ADO.NET Data providers
Post Reply
AnssiA
Posts: 6
Joined: Wed 04 May 2011 06:43
Location: Finland

Cannot add or update entity model (edmx) with visual studio 2013 or 2015 & Entity Framework 6

Post by AnssiA » Wed 03 Feb 2016 13:38

This problem started when we updated EF Version to 6. With VS 2012 updating model still works.
When trying to add edmx entity model to project or trying to update existing model, I get error:

"Your project references the latest version of Entity Framework; however, an Entity Framework database provider compatible with this version could not be found for your data connection. if you have already installed a have already installed a comptible provider, ensure you have rebuilt your project before performing this action. Otherwise, exit this wizard, install a compatible provider, and rebuid your project before performing this action."

Support from this did not help: http://blog.devart.com/entity-framework ... force.html
Could you provide a solution how to do this?

We are using latest version of dotConnect for Oracle

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

Re: Cannot add or update entity model (edmx) with visual studio 2013 or 2015 & Entity Framework 6

Post by Shalex » Wed 03 Feb 2016 15:04

With EDM Designer, you should add registration of EF6 provider in your app.config manually and rebuild (!) the project before running the wizard (http://blog.devart.com/entity-framework ... gistration):

Code: Select all

<?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="Devart.Data.Oracle" type="Devart.Data.Oracle.Entity.OracleEntityProviderServices, Devart.Data.Oracle.Entity, Version=8.5.583.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.5.583.0, Culture=neutral, PublicKeyToken=09af7300eec23701" />
    </DbProviderFactories>
  </system.data>
</configuration>
Replace 8.5.583 here with your current version of dotConnect for Oracle. Please note that the revision number of provider in the entityFramework section is 6 (8.5.583.6) but it should be 0 (8.5.583.0) in DbProviderFactories.

We recommend you to use Entity Developer (Devart Entity Model, *.edml) instead of EDM Designer (ADO.NET Entity Data Model, *.edmx) because it is adjusted for working with Oracle 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.

AnssiA
Posts: 6
Joined: Wed 04 May 2011 06:43
Location: Finland

Re: Cannot add or update entity model (edmx) with visual studio 2013 or 2015 & Entity Framework 6

Post by AnssiA » Thu 04 Feb 2016 07:25

I had already registered EF6 provider to app config, but I still get same error.
So is there more tricks what to try?

We have big existing ADO.NET Entity Data Model and it would be nice to update it with newer versions of Visual Studio.

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

Re: Cannot add or update entity model (edmx) with visual studio 2013 or 2015 & Entity Framework 6

Post by Shalex » Thu 04 Feb 2016 08:52

1. Specify the exact (x.x.x) version of dotConnect for Oracle you are using.
2. Send us a small test project for reproducing the issue.

AnssiA
Posts: 6
Joined: Wed 04 May 2011 06:43
Location: Finland

Re: Cannot add or update entity model (edmx) with visual studio 2013 or 2015 & Entity Framework 6

Post by AnssiA » Thu 04 Feb 2016 11:45

Support request is now sent with this same subject.

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

Re: Cannot add or update entity model (edmx) with visual studio 2013 or 2015 & Entity Framework 6

Post by Shalex » Thu 04 Feb 2016 14:14

Thank you for the test project. Implement the following changes in your project:

1. In \Edmx-test\Edmx-test\App.config replace

Code: Select all

<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.2.0,
with

Code: Select all

<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0,
2. In \Edmx-test\Edmx-test\Edmx-test.csproj replace

Code: Select all

    <Reference Include="Devart.Data.Oracle, Version=8.5.583.0, Culture=neutral, PublicKeyToken=09af7300eec23701, processorArchitecture=MSIL" />
    <Reference Include="Devart.Data.Oracle.Entity, Version=8.5.583.0, Culture=neutral, PublicKeyToken=09af7300eec23701, processorArchitecture=MSIL">
      <SpecificVersion>False</SpecificVersion>
      <HintPath>..\..\..\Program Files (x86)\Devart\dotConnect\Oracle\Entity\EF6\Devart.Data.Oracle.Entity.dll</HintPath>
    </Reference>
with

Code: Select all

    <Reference Include="Devart.Data, Version=5.0.1375.0, Culture=neutral, PublicKeyToken=09af7300eec23701, processorArchitecture=MSIL">
      <HintPath>C:\Program Files (x86)\Devart\dotConnect\Oracle\Devart.Data.dll</HintPath>
    </Reference>
    <Reference Include="Devart.Data.Oracle, Version=8.5.583.0, Culture=neutral, PublicKeyToken=09af7300eec23701, processorArchitecture=MSIL">
      <HintPath>C:\Program Files (x86)\Devart\dotConnect\Oracle\Devart.Data.Oracle.dll</HintPath>
    </Reference>
    <Reference Include="Devart.Data.Oracle.Entity, Version=8.5.583.6, Culture=neutral, PublicKeyToken=09af7300eec23701, processorArchitecture=MSIL">
      <HintPath>C:\Program Files (x86)\Devart\dotConnect\Oracle\Entity\EF6\Devart.Data.Oracle.Entity.dll</HintPath>
    </Reference>
Rebuild the project and try running EDM Wizard again.

AnssiA
Posts: 6
Joined: Wed 04 May 2011 06:43
Location: Finland

Re: Cannot add or update entity model (edmx) with visual studio 2013 or 2015 & Entity Framework 6

Post by AnssiA » Fri 05 Feb 2016 09:00

This solved problem with new project but not the existing project.
Did the same stuff with references & app.config there, but did not help.

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

Re: Cannot add or update entity model (edmx) with visual studio 2013 or 2015 & Entity Framework 6

Post by Shalex » Fri 05 Feb 2016 14:17

1. Is the error text the same?

2. Try readding references to
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

Rebuild the project and try running EDM Wizard again. If this doesn't help, reupload the result project so that we can investigate it.

Post Reply