8

I reinstalled ODAC Oracle but keep getting following error

"Oracle Data Provider for .NET has been installed without a machine-wide configuration. However, a version of Oracle Data Provider for .NET has been detected in the Global Assembly Cache which may be incompatible. Please remove Oracle Data Provider for .Net from Global Assembly Cache an restart Visual Studio"

Should I care about this warning?

Chandan Rai
  • 9,879
  • 2
  • 20
  • 28
helpME1986
  • 933
  • 3
  • 12
  • 26
  • Which version of ODAC did you install? Does it match with your installed Oracle Client? Which reference do you have in your *.csproj, resp. *.vbproj file? – Wernfried Domscheit Feb 03 '17 at 12:10
  • 1
    I realised I have differenmt version of ODAC and client. I deleted it and reinstalled same 11.2.0.3 version and I get: The ADO.NET provider with invariant name 'Oracle.ManagedDataAccess.Client' is either not registered in the machine or application config file, or could not be loaded. See the inner exception for details. I guess I deleted too much.... help much appreciated – helpME1986 Feb 03 '17 at 17:02
  • You mixed something, show us your code – Wernfried Domscheit Feb 03 '17 at 17:28
  • It does not look like it is a mattaer of code. I unistalled all Oracle clients, then installed ODAC 12.0.2 and it works. I mean I do not get any warning and I can modify database both using code first and database first approaches. Seems ODAC package consists of clients driver or am I totall wrong? – helpME1986 Feb 06 '17 at 10:51

1 Answers1

0

I did a lot of stuff which didn't helped. But one thing did.: open visual Studio Command prompt in admin mode https://learn.microsoft.com/en-us/dotnet/framework/tools/developer-command-prompt-for-vs

there you have to use gacutil /l to list all assemblies https://learn.microsoft.com/en-us/dotnet/framework/tools/gacutil-exe-gac-tool

Then delete every entry which includes oracle:

gacutil /u [assembly name]

you can get the assembly name out of the list before. Just use the term before the first comma (e.g. Oracle.ManagedDataAccess)

After that I opened Visual Studio and the error message disappeared. What happened was, that in the machine.config were entries which I needed to delete. Which one you have to delete shows the error while you debugg the code.

Hope it will help.

Egg Mac
  • 11
  • 1