Oracle .Net ManagedDataAccess Error: Could not load type 'OracleInternal.Common.ConfigBaseClass' from assembly

前端 未结 9 1684
被撕碎了的回忆
被撕碎了的回忆 2020-12-13 10:10

I have a project that works locally, on our dev server, and on our production server.

When I try to run it on the test server, I get the error below, and I don\'t kn

相关标签:
9条回答
  • 2020-12-13 10:46

    You need to install the Oracle Client drivers. The .NET packages don't contain them; they provide a translation from the managed world to the unmanaged. The drivers are in the unmanaged world and need to be installed properly.

    0 讨论(0)
  • 2020-12-13 10:47

    There is a conflict between Oracle.ManagedDataAccess from NuGet and the one that is installed (by Oracle client installation) on a server and that is registered in GAC.

    Unregister Oracle.ManagedDataAccess from GAC and you will get rid of the error: Run command line and navigate to the directory:

    {Oracle home}\product\{version}\client_64\ODP.NET\managed\x64

    There you should find OraProvCfg.exe file. Run the following command to unregister Oracle.ManagedDataAccess from GAC:

    OraProvCfg /action:ungac /providerPath:Oracle.ManagedDataAccess 
    
    0 讨论(0)
  • 2020-12-13 10:51

    You have to remove the Oracle.ManagedDataAccess assembly in your GAC (C:\Windows\Microsoft.NET\assembly...)

    Use the command tool gacutil to remove the assembly:

    C:\Program Files (x86)\Microsoft SDKs\Windows\YOUR_VERSION\bin\NETFX 4.6.1 Tools> gacutil /u Oracle.ManagedDataAccess

    0 讨论(0)
  • 2020-12-13 10:55

    As others said you need to remove Oracle.ManagedDataAccess from GAC.

    I run {Oracle home}\product\12.1.0\dbhome_1\ODP.NET\managed\x64\unconfigure.bat and {Oracle home}\product\12.1.0\dbhome_1\ODP.NET\managed\x836\unconfigure.bat and it worked

    0 讨论(0)
  • 2020-12-13 11:02

    Was able to fix it by replacing references in the project to Oracle.ManagedDataAccess and Oracle.ManagedDataAccess.EntityFramework from those installed by the package manager to those installed by the oracle client installer. The versions are the same but the build number is different on those DLLs

    0 讨论(0)
  • 2020-12-13 11:04

    We had the exact same problem as Dylan above. The issue appears to be with that specific Oracle version (4.121.2.0).

    The solution was simple: Just go into Nuget and move up to the next version of your Nuget package for the Oracle.ManagedDataAccess.Client, 4.122.1.0.

    Once we did that we could have mixed Oracle client or no-client environments or servers with or without the GAC Oracle installed, keep older apps that still use the GAC, and add new projects that use the Nuget packages. Its always a bad idea in these blogs to ask people to uninstall legacy stuff - like remove the Oracle dll in the GAC on a server - when you have environments with many legacy dependancies that still might reference it.

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