4

I use Entity Framework 5 together with Oracle.ManagedDataAccess. Visual Studio says there is a error in my edmx file:

Error 175: The specified store provider cannot be found in the configuration, or is not valid.

My Application compiles and runs without any problem. I cannot use the Model Browser an Entity Model Designer is unable to display the edmx file.

It works when I reconfigure the dataprovider from Oracle.ManagedDataAccess to Oracle.DataAccess, but Oracle components are installed only on my development machine, so I cannot use Oracle.DataAccess.

Here is my web.config:

<configSections>
  <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
  <section name="oracle.manageddataaccess.client" type="OracleInternal.Common.ODPMSectionHandler, Oracle.ManagedDataAccess, Version=4.121.2.0, Culture=neutral, PublicKeyToken=89b483f429c47342" />
</configSections>

<!-- ... -->

<system.web>
  <httpRuntime targetFramework="4.5" />
  <compilation debug="true" targetFramework="4.5">
    <assemblies>
      <add assembly="System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
    </assemblies>
  </compilation>
</system.web>

<!-- ... -->

<entityFramework>
  <defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
    <parameters>
      <parameter value="v11.0" />
    </parameters>
  </defaultConnectionFactory>
</entityFramework>

<!-- ... -->

<system.data>
  <DbProviderFactories>
    <remove invariant="Oracle.ManagedDataAccess.Client" />
    <remove invariant="Oracle.DataAccess.Client" />
    <add invariant="Oracle.ManagedDataAccess.Client" name="ODP.NET, Managed Driver" description="Oracle Data Provider for .NET, Managed Driver" type="Oracle.ManagedDataAccess.Client.OracleClientFactory, Oracle.ManagedDataAccess, Version=4.121.2.0, Culture=neutral, PublicKeyToken=89b483f429c47342"
    />
  </DbProviderFactories>
</system.data>

<!-- ... -->

<runtime>
  <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
    <dependentAssembly>
      <publisherPolicy apply="no" />
      <assemblyIdentity name="Oracle.ManagedDataAccess" publicKeyToken="89b483f429c47342" culture="neutral" />
      <bindingRedirect oldVersion="4.121.0.0 - 4.65535.65535.65535" newVersion="4.121.2.0" />
    </dependentAssembly>
  </assemblyBinding>
</runtime>

<!-- ... -->

<oracle.manageddataaccess.client>
  <version number="*">
    <dataSources>
      <dataSource alias="datasource" descriptor="dummydescriptor" />
    </dataSources>
  </version>
</oracle.manageddataaccess.client>

<!-- ... -->

<connectionStrings>
  <add name="myEntities" connectionString="metadata=res://*/myModel.csdl|res://*/myModel.ssdl|res://*/myModel.msl;provider=Oracle.ManagedDataAccess.Client;provider connection string=&quot;dummy&quot;" providerName="System.Data.EntityClient" />
</connectionStrings>

Part of my edmx:

<?xml version="1.0" encoding="utf-8" ?>
<edmx:Edmx Version="3.0" xmlns:edmx="http://schemas.microsoft.com/ado/2009/11/edmx">
  <!-- EF Runtime content -->
  <edmx:Runtime>
    <!-- SSDL content -->
    <edmx:StorageModels>
      <Schema Namespace="Model.Store" Alias="Self" Provider="Oracle.ManagedDataAccess.Client" ProviderManifestToken="11.2" xmlns:store="http://schemas.microsoft.com/ado/2007/12/edm/EntityStoreSchemaGenerator" xmlns="http://schemas.microsoft.com/ado/2009/11/edm/ssdl">

I use Visual Studio 2012 and have Oracle Tools for Visual Studio installed.

I there a way to get rid of this error message?

Thanks in advance

stop-cran
  • 4,229
  • 2
  • 30
  • 47
smartwepa
  • 311
  • 1
  • 3
  • 11

1 Answers1

0

I had this same error message on my new laptop. I'm running Visual Studio 2019 (v16.4.5). The project containing my model-first .edmx files was a .NET 4.6 class library with references to Oracle.ManagedDataAccess.dll v12.1.24160719 and Oracle.ManagedDataAccess.EntityFramework.dll v12.1.2400.

The fix was to download and install the Oracle Developer Tools for Visual Studio 2019. This .vsix file can be downloaded here: https://www.oracle.com/database/technologies/dotnet-odtvsix-vs2019-downloads.html

Now I can work with my .edmx files in the designer just like I could on my old laptop.