Last post Oct 14, 2015 06:24 AM by Raha06
Oct 12, 2015 12:34 PM|Raha06|LINK
I'm trying to build a webAPI. This webAPI is going to request my database and return an array of object.
The business layer and database acces layer are already developed. They are in a class library project. So what I did in my WebAPI, is to add a reference to the dll generated by my class library project.
The webAPI works with Visual Studio when I test it. But when I host the webAPI on IIS, I've got an error "
This Oracle.DataAccess is a dll referenced from my class library, but it seems the webAPI cannot deal with it.
So I tried to add a reference to this Oracle.DataAccess.dll in my webAPI as well, but the result is the same, I have the same error message.
Do you have an idea of what I am doing wrong?
Oct 12, 2015 09:10 PM|santhoshje|LINK
Looks like you are having wrong version of Oracle data access library. Please confirm your windows is 32 or 64 bit. If OS is 64 bit, then you need to install install data access library that supports 64 bit. Also you need to install oracle library based
on your .Net framework version.
Oct 13, 2015 04:01 AM|Raha06|LINK
Thanks for your answer.
You got the point, this is issue is related to 32bit/64bit compatibility.
The IIS server is on a 64 bit server. On the same IIS server, I've got a website application using the same Oracle dll, this is working well.
My website works well, but my WebAPI does not. I noticed that If i change the "Enable 32-bit applications" from False to True, then my WebAPI works but my website doesn't work anymore.
I don't want to create a dedicated application pool for the webAPI and set the "Enable 32-bit applications" to True.
What can i do? Do I have to compile the webAPI and/or class library with a particular "Platform target". Currently, both are compiled with "Any CPU".
Oct 13, 2015 09:41 PM|santhoshje|LINK
Looks like Oracle data access dll refrenced in Web Api project is 32 bit. Remove existing Oracle data access refrence.
Right click the project file and choose Manage Nuget package menu item.Then install odp.net.x64 nuget package using Nuget Package Manager.
Oct 14, 2015 06:24 AM|Raha06|LINK
Yes!! That worked for me!! Thanks a lot.
I was confused, because the IT administrator told me he had installed the 32 bit version of the client on the server.