ORACLE and Entity Framework. Error:the specified store provider cannot be found in the configuration or is not valid

前端 未结 6 1933
眼角桃花
眼角桃花 2020-12-18 09:12

In my project I am using oracle and entity framework together.Both of my machines my developer machine win7 and my server win2008r2 I installed oracle beta entity framework

相关标签:
6条回答
  • 2020-12-18 09:35

    We were installing our application on a windows 2012 server and we were getting the same error, we tried to run the applications in the 32 bit mode , but results are same. we tried to get the list of DbProviderFactories installed in the machine by a console app and figured out that the ODP.net Managed Driver is missing. it finally worked when we ran the batch file we found

    0 讨论(0)
  • 2020-12-18 09:36

    In the Application Pool and Advanced Settings...

    Have a look at the "Enable 32-Bit Applications" and see if it is enabled. It wasn't set on my Windows 7 64bit and I had the same issues.

    I am guessing it might also be fixed by installing the 64bit ODAC but haven't tried that yet.

    0 讨论(0)
  • 2020-12-18 09:38

    Installing ManagedDataAcces solved the problem for me.

    0 讨论(0)
  • 2020-12-18 09:49

    I had this problem before. I followed these instructions then it solved: with windows 10 x64

    1- Install Visual Studio 2015.

    2- Install ODAC from http://www.oracle.com/partners/campaign/utilsoft-086879.html.

    1. install ODTforVS2015 from http://www.oracle.com/technetwork/topics/dotnet/downloads/odacmsidownload-2745497.html

    2. copy tnsnames file witch configured in step #2 and paste it to Network folder of destination installation of step #3.

    3. change C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config\Machine.config <system.Data> tag like this:

      <system.data>
      <DbProviderFactories>
          <add name="ODP.NET, Unmanaged Driver"  invariant="Oracle.DataAccess.Client" description="Oracle Data Provider for .NET, Unmanaged Driver" type="Oracle.DataAccess.Client.OracleClientFactory, Oracle.DataAccess, Version=4.121.1.0, Culture=neutral, PublicKeyToken=89b483f429c47342" />
      <add name="ODP.NET, Managed Driver" invariant="Oracle.ManagedDataAccess.Client" 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>
      
    4. add this line in web.config for web app, or in App.config if it is console App. under <configurations> </configurations> tag (Under not inside).

      <system.data>
          <DbProviderFactories>
            <add name="ODP.NET, Managed Driver" invariant="Oracle.ManagedDataAccess.Client" 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>
      
    0 讨论(0)
  • 2020-12-18 09:53

    If you are getting this error in 2018 and you are using IIS Express like I am, you may want to check your .csproj settings and ensure that it is running under x64 bitness. (Right click you web application's csproj, go to "Web" tab, under the "Servers" section, change the bitness to x64).

    0 讨论(0)
  • 2020-12-18 09:55

    in short: do not use ODAC .net drivers, instead use oracle client complete installation. modifying ODAC components may be a bit diffucilt. So install latest version of oracle client to all machines everything is well.

    • old answer - For both machines I installed first oracle data provider for .net and then oracle beta entity framework providers . So for both machines I have multiple oracle client instances.

    In my development machine oracle beta entity framework is configured as default client. -I dont know when/how it changed/ who changed -

    In server default provider is still old odp.net .

    After changing the default provider at server to oracle beta entity framework provider it changed.

    Thanks again.

    0 讨论(0)
提交回复
热议问题