2

I have programmed (with Visual Studio, C#) an application that connects to an Oracle database and does stuff. It works fine on my pc with sample database, my Windows is 32 bit, but as soon as I upload it to the server which has a 64 bit Windows, I get an error:

The provider is not compatible with the version of Oracle client

I have set target platform on "any cpu" in Visual Studio.

What should I do to have it run on both 32 bit and 64 bit Windows?

marc_s
  • 675,133
  • 158
  • 1,253
  • 1,388
nnmmss
  • 2,280
  • 6
  • 30
  • 49
  • 1
    What version of Oracle client is installed on the server? – mjwills Dec 10 '17 at 11:08
  • https://stackoverflow.com/questions/659341/the-provider-is-not-compatible-with-the-version-of-oracle-client https://stackoverflow.com/questions/17425538/how-to-fix-the-provider-is-not-compatible-with-the-version-of-oracle-client – Hadi Dec 10 '17 at 13:30

1 Answers1

1

C# Database providers are usually 32bit or 64bit (you didn't state the database provider you used).

If you set your program to be any CPU , at run time it will be compiled to either 32bit or 64bit which is determined by locally installed .Net framework.

Since your developing machine is 32bit , it runs as 32bit and has locally installed database provider of 32bit.

When you try to run it on your server , it runs as 64bit and doesn't find a provider for 64bit.

You seems to either need to install a 64bit provider on your server or compile your program to x86.

Hagay Goshen
  • 477
  • 2
  • 10