vb.netvisual-studiooracle-databaseentity-frameworkvista64

Unable to access oci.dll due to application type


I am using attempting to create a connection to an Oracle database via entity framework in Visual Studio 2008. I am running 64 bit Vista Ultimate.

At first, I had difficulty even making a connection to the db through Visual Studio, but eventually got things working by installing 10204_vista_w2k8_x64_production_db AND ODTwithODAC1110720, but only the minimal parts needed to interface via Visual Studio.

I am completely new to this setup, so it's likely I have already made a mistake, but installing both packages is the only way I could create a connection via Visual Studio.

I made the connection, and used the wizard to create a . edmx file. The model and associations were created perfectly, and I thought things were going to work well. I used the default name "Entities" as the reference name.

When I try to do the following

filingsContext = New Entities()
filingsContext.TABLE_NAME_HERE.First()

I get this following error..

InnerException = {"Unable to load C:\app\adexter\OraHome_1\oci.dll. Please check that you use 64x version of Oracle client with 64x application."}

How is it that I can connect to the oracle db at every point except when I'm running the application?


Solution

  • The problem you are running into is that you are trying to load a 32 bit version of the DLL within a 64 bit application. Try switching your Visual Basic application to target 32 bit / x86 and that should fix the problem

    1. Right Click on the project in solution explorer
    2. Select Properties
    3. Go to the Compile Tab
    4. Click on Advanced Compile Options
    5. Change Target CPU Combo to x86
    6. Hit OK