Home > front end >  'Oracle.DataAccess.Client.OracleConnection' threw an exception, WinForms Application
'Oracle.DataAccess.Client.OracleConnection' threw an exception, WinForms Application

Time:04-09

I have a WinForms application in a .NET Framework 4.5.2 and an Oracle 10g database. This application works perfectly fine when I debug it using VS 2017, but when I deploy it as a ClickOnce application [using ClickOnce Deployment Manifest] it does not work and I keep getting the following error.

Image of the error upon connecting

relevant error text follows:

just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.TypeInitializationException: The type initializer for 'Oracle.DataAccess.Client.OracleCommand' threw an exception. ---> Oracle.DataAccess.Client.OracleException: The provider is not compatible with the version of Oracle client
   at Oracle.DataAccess.Client.OracleInit.Initialize()
   at Oracle.DataAccess.Client.OracleCommand..cctor()
   --- End of inner exception stack trace ---

It also runs perfectly fine when running the it from bin/Release folder, how can I make so that my deployed application runs like my local .exe in my repo.

And an additional piece of info, this WPF application is just a menu so that it runs my other WinForms applications, they work perfectly fine even when published, I have ensured that all applications are targeting an (x86) architecture and that all the ClickOnce settings are the same, to no avail.

Or can I even recreate the error when debugging so that I can fix? I tried forcing 64 - bit mode (since that is what my machine is) in the properties of the project, but it does not even load. In the ClickOnce application it loads to the log-in page, but messes up when establishing a connection after the user has entered their credentials.

This is my first post so please fell free to request any more info and let me know if I have been unclear in anyway.

Thank you for the help in advance !

CodePudding user response:

The issue has been resolved, but if anyone else come across it here is the solution, you have to find and add the appropriate DLL's manually into your project. I guess as mentioned in other answers, when the error says "...Client is not compatible..." it can also mean that the appropriate files do not exist.

  • Related