-2

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 !

  • Please don't paste images, use formatted text, see https://meta.stackoverflow.com/q/285551 Note, the "Ctrl+C" also works on the message in the error dialog. – Wernfried Domscheit Apr 06 '22 at 06:48
  • See https://stackoverflow.com/questions/659341/the-provider-is-not-compatible-with-the-version-of-oracle-client#25412992 for probable causes – Wernfried Domscheit Apr 06 '22 at 06:51
  • Thank you I did, but to no avail, i think the problem is with the way ClickOnce publishes it, but I am not too experienced with it and cant find much documentation on it. – Sawoud Al-Los Apr 06 '22 at 14:19
  • As long as you don't provide any error message, you will not get much help, I assume. – Wernfried Domscheit Apr 06 '22 at 14:30
  • But the attached image is the only error I get – Sawoud Al-Los Apr 06 '22 at 15:15
  • See my first comment! Do you see any relevant error message in the picture where most part of the error is cut off? Apart from that, I usually refuse to take any deeper look at such images. – Wernfried Domscheit Apr 06 '22 at 15:20
  • Hello, forgive me I misunderstood at first, I have added the relevant error info in the post now, thank you for bringing that up and again I apologize for missing that. – Sawoud Al-Los Apr 06 '22 at 19:38
  • Did you have a look at my first comment. There I listed the typical causes. With `connection.GetType().Assembly.Location` you can check which DLL is actually loaded. Note, in the reference properties you define "Copy Local", perhaps you missed it. Be aware the DLL from GAC take precedence over locally copied files. – Wernfried Domscheit Apr 07 '22 at 04:29
  • Hello, thank you the issue has been fixed. I had to add the appropriate DLL's manually to the solution. Again thank you for the help, I appreciate it ! – Sawoud Al-Los Apr 08 '22 at 15:13

1 Answers1

1

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.