locked
Oracle Error on x64 bit RRS feed

  • Question

  • Hello everybody,

      I compiled my application as x64 bit and tried to run it on x64 installation of Server 2003. When connecting to Oracle my application has issued the following error:

    System.InvalidOperationException: Attempt to load Oracle client libraries threw BadImageFormatException.  This problem will occur when running in 64 bit mode with the 32 bit Oracle client components installed. ---> System.BadImageFormatException: An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)
       at System.Data.Common.UnsafeNativeMethods.OCILobCopy2(IntPtr svchp, IntPtr errhp, IntPtr dst_locp, IntPtr src_locp, UInt64 amount, UInt64 dst_offset, UInt64 src_offset)
       at System.Data.OracleClient.OCI.DetermineClientVersion()
       --- End of inner exception stack trace ---
       at System.Data.OracleClient.OCI.DetermineClientVersion()
       at System.Data.OracleClient.OracleInternalConnection.OpenOnLocalTransaction(String userName, String password, String serverName, Boolean integratedSecurity, Boolean unicode, Boolean omitOracleConnectionName)
       at System.Data.OracleClient.OracleInternalConnection..ctor(OracleConnectionString connectionOptions)
       at System.Data.OracleClient.OracleConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningObject)
       at System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options)
       at System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject)
       at System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject)
       at System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject)
       at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)
       at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
       at System.Data.OracleClient.OracleConnection.Open()
       at STPSendMailData.BaseData.SetConnectionAndTransaction()

    It was running fine on my dev workstation. The server has installation of framework 2.0 x64. I wonder what I did do wrong, what are possble causes and what is a fix for the problem?

     

    Thanks to all;) 

    Wednesday, June 7, 2006 2:40 PM

Answers

  • I have found the reason for your problem there is some setting in IIS7 that is not in IIS7.5 because in IIS7 if you right click on your application pool name and go to advanced setting you need to set enable 32bit application to true.  And the link below covers application pool identities.


    http://learn.iis.net/page.aspx/624/application-pool-identities/


    MCPD Web C#, MCTS TFS, MCITP BI and DBA
    Friday, May 28, 2010 2:00 PM
    Moderator
  • From the looks of the exception it seems that you need ot install the 64-bit Oracle client components.

    -josh

    Wednesday, June 14, 2006 8:14 PM
    Moderator
  • Yes. What eventually happened our Sys Admins and DB Admins installed Oracle 10g client for 64-bit OS. It worked.
    Friday, June 1, 2007 5:33 PM

All replies

  • From the looks of the exception it seems that you need ot install the 64-bit Oracle client components.

    -josh

    Wednesday, June 14, 2006 8:14 PM
    Moderator
  • Thanks Josh,

    We figured this and I requested 64 bit install already. When it is there I will post message saying if this resolved problem. If there are any other ideas please let me know.

    Regards,

     

       Michael

    Thursday, June 15, 2006 3:08 PM
  • hobbitenok2005,

    Did you fix your problem with the 64 bit oracle client?

    Thanks.

    Thursday, August 3, 2006 4:19 PM
  • While you wait for 64-bit client, you can try  recompiling your application as x86 would make the application work. (assuming that you have a 32-bit oracle client installed on x64 box)... This would make the app work as a 32-bit app, though..

    Hope this helps!

    Monday, August 7, 2006 7:47 PM
  • I compile my application as x86 and I have 32-bit Oracle client installed on x64 box. It gave me exactly the same exception (BadImageFormatException).

    It would work if I compile the application as anycpu, because we also have 64-bit Oracle client installed. But since we need to use some legacy 32-bit dlls. we have to compile the application as x86.

    Help is really appreciated. I could provide a simple testing code if necessary.

     

    Wednesday, August 9, 2006 8:27 PM
  • Hi chenzu,

    maybe you have to try something else. I have no idea how it is to work on x64bit Platform but maybe you have to force one specific OCI library to be loaded before using the OracleClient provider. Maybe your problem has to do with the fact that you have x32 and x64 Oracle Clients installed (hope in different OracleHomes) and that your application loads in each case the wrong library image.

    Because I suppose that the OCI library is loaded with DllImport attribute which default to what windows wants I want to suggest you to load a specific OCI library in memory before your application logic starts and see what happens.

    You have to create an inport wrapper for LoadLibrary Win32 function and call it with the path to the propper OCI, from x64 application the x64 client DLL and from x32 Application the x32 Client DLL.

    I hope this will help, regards,

    Marian

    Friday, September 8, 2006 2:37 PM
  • Change the machine.config for the x64 .

     

    Add the following binding policy:

    Code Snippet
        <runtime>
        <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
          <dependentAssembly>
            <assemblyIdentity name="Oracle.DataAccess" publicKeyToken="89b483f429c47342" />
            <bindingRedirect oldVersion="2.0.0.0-10.9.9.9" newVersion="2.102.3.2" />
          </dependentAssembly>
        </assemblyBinding>
      </runtime>
       
         
           
           
         
       
     

     

     

    If you want your application to force using 64-bit client when running in 64-bit more (tested on AMD 64) use the following code in app.config of your file:

     

    Code Snippet

        <runtime>
        <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
          <dependentAssembly>
            <assemblyIdentity name="Oracle.DataAccess" publicKeyToken="89b483f429c47342" processorArchitecture="amd64" />
            <bindingRedirect oldVersion="2.0.0.0-10.9.9.9" newVersion="2.102.3.2" />
          </dependentAssembly>
        </assemblyBinding>
      </runtime>
       
         
           
           
         
       
     

     

     

    processorArchitecture and bindingRedirect can work wonders for you... changing the redirections and processorArchitecture will help u eliminate the badImageException.

     

    Cheers!

    Deepak.

    Friday, May 18, 2007 8:51 PM
  • I am facing the same issue. Please help!! Did you find a solution??
    Friday, June 1, 2007 5:18 PM
  • Yes. What eventually happened our Sys Admins and DB Admins installed Oracle 10g client for 64-bit OS. It worked.
    Friday, June 1, 2007 5:33 PM
  •  hobbitenok2005 wrote:
    Yes. What eventually happened our Sys Admins and DB Admins installed Oracle 10g client for 64-bit OS. It worked.

     

    Same here.  I don't know why this solution didn't seem more obvious before.

    non profit software pac software non-profit donor software donor software donor management donation software member management non-profit software pledge collection member dues software non profit analysis

    Monday, June 4, 2007 4:42 PM
  • Have you tried to install 32 bit Oracle client inside C:\Program Files (x86)\ folder?

     

     

    Jdang

    Tuesday, February 5, 2008 7:51 PM
  • Forgive me for jumping in here, but can you explain what you think will happen if you do as you have suggested?

     

    (I assume that you will install as C:\Program Files (x86)\Oracle\etc)

     

    Is there some special behaviour inherited by having code in this folder?

     

    Friday, April 11, 2008 5:12 PM
  • (I assume that you will install as C:\Program Files (x86)\Oracle\etc)

     

    Is there some special behaviour inherited by having code in this folder?)

     

     

    The answer is no because I always run my Oracle client in my D drive which is also where my development folder is located because that is also the place I put my TNSNAMES.ORA file.  Since Oracle 9i RC2 I have not used 32bits Oracle for .NET development both Winform and Webform you actually need the Oracle client for your Operating system to get Oracle to work so if you are in XP 32bits you install Oracle any version 32bits client for XP.  If your Operating system is 64bits then you need x64 Oracle any version client software to develop and in VS2005/8 use build option AnyCPU. 

     

    Monday, April 21, 2008 3:38 PM
    Moderator
  • I have a related issue.

    I have the 11g 64bit client loaded on Vista 64.  I can connect to Oracle via SQLPLUS and IIS apps can connect, but when I try to create a data connection in VS 2008 I get the same error (Attempt to load Oracle client libraries threw BadImageFormatException.)

    Anyone else run into this problem?  If so, what did you do to fix it?

    • Proposed as answer by PonalSuper3 Thursday, November 11, 2010 11:08 AM
    • Unproposed as answer by CaddreModerator Thursday, November 11, 2010 1:21 PM
    Tuesday, April 22, 2008 7:37 PM
  • Oracle client for 11g is almost 3gig file are you saying you have downloaded and installed the 64bits version for Vista and still getting the above exception?  If yes then make sure you have added all the references needed to use Oracle and put your TNSNAMES.ORA file in your development folder.

     

    Tuesday, April 22, 2008 7:53 PM
    Moderator
  • The problem I faced was because of the fact that I had to use both 64-bit (oracle client) and 32-bit client because we had some legacy applications which run on the same server.

    Wednesday, April 23, 2008 1:07 AM
  • I don't think you need both because in a 32bits operating system you can use Oracle client for the operating system without problems because Win2003 will run AnyCPU code without issues because I just develop other people test and deploy the code.  And I will not modify Machine.ConFig file because I know it is not needed.

     

    Wednesday, April 23, 2008 2:39 AM
    Moderator
  • The server which I deployed was a Win2003 server running 64-bit OS and I am talking about Oracle client published by Oracle (ODP.NET) and not the one which ships with the framework.

    Wednesday, April 23, 2008 4:52 AM
  • That is just an option because Win2003 x64 SP2 and above will run any code against Oracle x64 as AnyCPU if your legacy application is not running dependent component which must be x86.

     

    Wednesday, April 23, 2008 1:18 PM
    Moderator
  • It is difficult to believe that such a problem still remains unresolved. Here's the situation I am having:

    I have installed Oracle Client 64bit on Vista x64 to access a 9i database. It all works fine from Net Manager when testing the connection so I know for sure that I can connect to the database using 11g client. I've got a web service which is complied in Any CPU mode. This web service makes a call to a stored proc in 9i database. The execute method on the command throws an execption saying:

    [InvalidOperationException: Attempt to load Oracle client libraries threw BadImageFormatException.  This problem will occur when running in 64 bit mode with the 32 bit Oracle client components installed.]
       System.Data.OracleClient.OCI.DetermineClientVersion() +459
       System.Data.OracleClient.OracleInternalConnection.OpenOnLocalTransaction(String userName, String password, String serverName, Boolean integratedSecurity, Boolean unicode, Boolean omitOracleConnectionName) +63
       System.Data.OracleClient.OracleInternalConnection..ctor(OracleConnectionString connectionOptions) +133
       System.Data.OracleClient.OracleConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningObject) +40
       System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) +29
       System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject) +433
       System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject) +72
       System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +457
       System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +100
       System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +116
       System.Data.OracleClient.OracleConnection.Open() +40

    The error says this error occurs when running in 64 bit mode with 32 bit Oracle Client components installed. Well, I believe that to be very misleading because I'm not running Oracle Client 32 bit! I had a look at the registered ODBC drivers on my machine. One is sql server and the other one is Oracle Client but the file it's using is called SQORA32.DLL which makes me think somehow oracle client is still using 32 bit dll instead of the 64 bit.

    Any help would be appreciated.

    Thanks.
    Tuesday, November 11, 2008 2:20 PM
  • Your problem is not relevant to this thread because Oracle does not support Vista in Oracle 9i which is seven years old.  So the solution is to use Oracle 10g X64 client which includes Vista to connect to Oracle 9i, so it is the 11g client that is the reason for the confusion.  I know you cannot use Oracle 10g client to connect to 8i because it will block the 8i point of connection so you use 9i.

    So here is the correct client you need and make sure your TNSNAMES.ORA file is in your development folder, you should also know Oracle 9i was the first 64bits Oracle so most things are not as expected.  So try to upgrade because most people upgraded back in 2006 because Oracle 9i is a 2001 product.


    http://www.oracle.com/technology/software/products/database/oracle10g/htdocs/10204_winx64_vista_win2k8.html

    Asp.net MVP, MCPD Web C#, MCTS TFS, MCITP BI and DBA
    Tuesday, November 11, 2008 4:14 PM
    Moderator
  • We are facing the same problem with 64-bit Oracle 10.2.0.4 client installed on 64-bit Windows 2008 Server.
    The installed SQL Server 2008 detects the Oracle installation and can resolve linked servers without any problems, VS2008 does not. This appears: Attempt to load Oracle client libraries threw BadImageFormatException.  This problem will occur when running in 64 bit mode with the 32 bit Oracle client components installed.
    Thursday, November 20, 2008 1:33 PM
  • VS2005/8 are 32bits IDE that can be used to develop 64 bits application but there are issues for using Oracle for x64 development however I have used it for AnyCPU so you should try AnyCPU.  Please make sure you are using current Oracle 64bits client and 64bits ODP.NET and use Any CPU.

    http://www.oracle.com/technology/software/tech/windows/odpnet/64-bit/index.html


    Asp.net MVP, MCPD Web C#, MCTS TFS, MCITP BI and DBA
    Thursday, November 20, 2008 2:45 PM
    Moderator
  •  I have read every item I could google to solve this issue but I still cannot create a Data Connection using Server Explorer inside VS 2008 Pro (SP1) with Vista Ultimate on a x64 machine.  I get the same error shown above without the stack trace, "Attempt to load Oracle client libraries threw BadImageFormatException."

    I have Oracle Database 10.2.0.4  for Vista and Windows Server 2008 (x64) with a very clean installation and Oracle Database Client 10.2.0.4 for Microsoft Windows x64 with little or no configuration beyond installation.

    I create a console app in VS 2008 and then try to 'Connect to Database' in the Server Explorer.  It works on my x86 machine but not on my x64 machine.

    Does this have to do with the installation of VS 2008 in the Program Files (x86)\... directory?


    Tuesday, December 30, 2008 7:07 AM
  • Here is a solution for Vista X64 and you must build X86 because Vista and Win2008 comes with new data access so the current solution does not work.  But try what is in the thread below.

    http://social.msdn.microsoft.com/Forums/en-US/netfx64bit/thread/9296e57a-b89e-4165-b25a-db58ceaa9ee0


    MCPD Web C#, MCTS TFS, MCITP BI and DBA
    Tuesday, December 30, 2008 1:07 PM
    Moderator
  • Dear,

    I installed oracle 10G database on our server Win 2003 64bit, with VS2005..

    i developed a web program on my Win XP 32  bit with oracle 9I when i deploy the system it gave me "Oracle client libraries threw BadImageFormatException.This problem will occur when running in 64bit mode whit the 32 bit Oracle Client components installed"

    so i did the following steps:

    1-  cscript %SYSTEMDRIVE%\inetpub\adminscripts\adsutil.vbs SET W3SVC/AppPools/Enable32bitAppOnWin64 0

    2- %SYSTEMROOT%\Microsoft.NET\Framework64\v2.0.50727\aspnet_regiis.exe -i

    actually after i did these two configuration it worked but only if i setup my Web on the server.

    now the program if i want to build my Asp.net program on the server using VS2005 the error will appear again i put the configuration manager as x86 or Mixed platform .. but no luck.

    if any one has the solution can please provide it to me....

    Many thanks


    Sunday, October 18, 2009 7:44 AM
  • I developed with both Oracle 9i and 10g and used AnyCPU build option in VS2005 so you problem must be related to you because there are more than 100 developers in the team all using WinXP using AnyCPU build option.  I would say remove IIS add it again this time click on details to add all the features needed to run Asp.net before running it as x86.


    MCPD Web C#, MCTS TFS, MCITP BI and DBA
    Sunday, October 18, 2009 2:23 PM
    Moderator
  • Dear Caddre,

    thanks alot for ur quick respond, as i mentiond before i'm not using win Xp any more i'm now using win 2003 server Xeon so when i'm trying build or run the system it gave me "Oracle client libraries threw BadImageFormatException.This problem will occur when running in 64bit mode whit the 32 bit Oracle Client components installed"

    so i did the following steps:

    1-  cscript %SYSTEMDRIVE%\inetpub\adminscripts\adsutil.vbs SET W3SVC/AppPools/Enable32bitAppOnWin64 0

    2- %SYSTEMROOT%\Microsoft.NET\Framework64\v2.0.50727\aspnet_regiis.exe -i

    actually after i did these two configuration it worked but only if i setup my Web on the server, but for the build no luck at all.

    thanks alot again.

    Sunday, October 18, 2009 2:38 PM
  • So where is the web server because if your web server is in another box then you need to install Oracle client in that server because Oracle client is required in any box that is connecting to Oracle server.  So if you are running 10g in Win2003 then install Oracle client in the server running IIS6  and make sure the TNSNAMES.ORA file is in the Oracle home folder.


    MCPD Web C#, MCTS TFS, MCITP BI and DBA
    Sunday, October 18, 2009 3:09 PM
    Moderator
  • Which version of oracle did you installed? I am facing the same issue, we are trying to migrate our .NET application on to windows 2008 and receiving the same error. It will be great if you can provide me with the link from where you installed oracle client.
    Tuesday, November 17, 2009 5:31 PM
  • http://www.dailycode.net/blog/post/Using-Oracle-client-32-bit-on-a-64-bit-computer.aspx
    it works for me
    • Proposed as answer by newen85 Tuesday, November 17, 2009 8:17 PM
    • Unproposed as answer by CaddreModerator Wednesday, November 18, 2009 1:06 AM
    • Proposed as answer by TheRave Tuesday, December 22, 2009 6:23 AM
    • Unproposed as answer by CaddreModerator Tuesday, December 22, 2009 1:56 PM
    Tuesday, November 17, 2009 8:16 PM
  • Which version of oracle did you installed? I am facing the same issue, we are trying to migrate our .NET application on to windows 2008 and receiving the same error. It will be great if you can provide me with the link from where you installed oracle client.

    Hi Piyush,

    Here is the link that explains how to fix it and to use Oracle OLE DB driver which you can download with the client from Oracle's site.

    http://www.landoris.com/blogs/darrin/index.php/2009/05/finally-an-oracle-x64-client-that-works-on-vista-aka-getting-map-2010-x64-running-with-oracle/
    MCPD Web C#, MCTS TFS, MCITP BI and DBA
    Tuesday, November 17, 2009 10:22 PM
    Moderator
  • I am developing the app for Windows 7 x64 and i tried installing those patches, but none of them is for Windows 7. Why I am looking for this 64bit version because I am getting following error:

    Database Connection Error Attempt to load Oracle client libraries threw BadImageFormatException. This problem will occur when running in 64 bit mode with the 32 bit Oracle client components installed. An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)

    I have following configurations:
    Windows 7 x64
    Oracle XE
    Visual Studio 2008 SP1
    .Net Framework 3.5 SP1

    and I am using System.Data.OracleClient.dll

    What I suspect is that the version of my System.Data.OracleClient.dll is compiled targeting x86 CPU. where as I need the one which is compiled of any CPU ... so that I can run My application any Where (32bit or 64bit).

    Please post the solution if you have any!
    Sunday, January 24, 2010 5:59 AM
  • I think Oracle is developing a new client for Windows 7 and Windows 2008 RC2 for VS2010 so you will get one in April,  I think you could use the x86 client for AnyCPU build in development.  I have not tried it with 11g but it worked in 9i and 10



    MCPD Web C#, MCTS TFS, MCITP BI and DBA
    Sunday, January 24, 2010 2:00 PM
    Moderator
  • Hello everybody,

      I compiled my application as x64 bit and tried to run it on x64 installation of Server 2003. When connecting to Oracle my application has issued the following error:

    System.InvalidOperationException: Attempt to load Oracle client libraries threw BadImageFormatException.  This problem will occur when running in 64 bit mode with the 32 bit Oracle client components installed. ---> System.BadImageFormatException: An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)
       at System.Data.Common.UnsafeNativeMethods.OCILobCopy2(IntPtr svchp, IntPtr errhp, IntPtr dst_locp, IntPtr src_locp, UInt64 amount, UInt64 dst_offset, UInt64 src_offset)
       at System.Data.OracleClient.OCI.DetermineClientVersion()
       --- End of inner exception stack trace ---
       at System.Data.OracleClient.OCI.DetermineClientVersion()
       at System.Data.OracleClient.OracleInternalConnection.OpenOnLocalTransaction(String userName, String password, String serverName, Boolean integratedSecurity, Boolean unicode, Boolean omitOracleConnectionName)
       at System.Data.OracleClient.OracleInternalConnection..ctor(OracleConnectionString connectionOptions)
       at System.Data.OracleClient.OracleConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningObject)
       at System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options)
       at System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject)
       at System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject)
       at System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject)
       at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)
       at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
       at System.Data.OracleClient.OracleConnection.Open()
       at STPSendMailData.BaseData.SetConnectionAndTransaction()

    It was running fine on my dev workstation. The server has installation of framework 2.0 x64. I wonder what I did do wrong, what are possble causes and what is a fix for the problem?

     

    Thanks to all;) 


    I was resolved this problem. If you are using Visual Studio, change the flatform target to x86 in Project Properties!
    Wednesday, March 24, 2010 4:01 AM
  • The standard solution for BadImageFormatException is ANYCPU build instead of x86 however I am glad to see your problem is resolved.  We used ANYCPU build with Oracle 9i and 10g with VS2005 without issues.


    MCPD Web C#, MCTS TFS, MCITP BI and DBA
    Wednesday, March 24, 2010 2:31 PM
    Moderator
  • http://www.codingbeaver.com/blog/index.php/2009/09/21/how-to-fix-system-data-oracleclient-badimageformatexception-error/
    Tuesday, April 20, 2010 9:00 AM
  • http://www.codingbeaver.com/blog/index.php/2009/09/21/how-to-fix-system-data-oracleclient-badimageformatexception-error/

    That may be related to Oracle 11g because we used Oracle 9i and 10g reason I just got my new Oracle developer of Windows 7 and Windows 2008 just a few days back.

    MCPD Web C#, MCTS TFS, MCITP BI and DBA
    Tuesday, April 20, 2010 1:39 PM
    Moderator
  • Ok let's add a slight twist here: I just want to open Oracle in the server explorer inside visual studio. Im thinking the x64 oracle client (11gr2) i have installed is bombing (with teh badimageformatexception) due to vs2008 itself being a 32 bit app. So it looks like I need the 32bit client to work with oracle *inside* visual studio. I am going to install the 32 bit client next and see if it helps. What a pain.

    Tuesday, May 25, 2010 8:05 PM
  • Ok let's add a slight twist here: I just want to open Oracle in the server explorer inside visual studio. Im thinking the x64 oracle client (11gr2) i have installed is bombing (with teh badimageformatexception) due to vs2008 itself being a 32 bit app. So it looks like I need the 32bit client to work with oracle *inside* visual studio. I am going to install the 32 bit client next and see if it helps. What a pain.


    You could just create a development folder and install the Oracle client in it, and it intalls in D drive I have run it in D drive for both 9i and 10g R1 and R2.
    MCPD Web C#, MCTS TFS, MCITP BI and DBA
    Tuesday, May 25, 2010 8:18 PM
    Moderator
  • I have tried nearly everything, and unable to solve this problem. I am trying to connect to an 64 bit oracle server installed on an 64-bit 2008 server.

     

    My application (web based) was working on 32-bit oracle server on 32-bit 2008 server. But now it raises this exception when it is published (using any Cpu). Also I am unable to connect to the database from Visual studio (xsd's or server explorer).  When i try to build and publish targeting x86, nothing changes.

    I am starting to think that it will never be solved. I am very curious about how you solved this problem..

     

    Oguz

    Wednesday, May 26, 2010 2:23 PM
  • Oralce just released the Windows 2008 and Windows 7 client you need to download and install it, then add your TNSNAMES.ORA file in the install folder because most issues with Windows 2008 and 7 was related to no valid Oracle client.  You should also know the Oracle installer is not very good so you have to watch is so it does not add what you don't need.

    http://www.oracle.com/technology/tech/windows/index.html


    MCPD Web C#, MCTS TFS, MCITP BI and DBA
    Wednesday, May 26, 2010 2:39 PM
    Moderator
  • I think you mean 11g release 2 client for Windows x64. I tried this version of oracle client too, but it did not work. 
    Wednesday, May 26, 2010 2:55 PM
  • I setup a new computer with 64-bit windows 7 and oracle 10g x64 client.

    I created a new test windows forms application to test the connection to the oracle server. I added a dataset to the project and tried to add a table adapter using an oracle connection. However when i test the connection, a popup screen appeared saying the exception (the same one when i tried to modify my xsd's). I tried to target to x86. x64 or anyCPU but no way.

    Wednesday, May 26, 2010 3:03 PM
  • The best way to resolve this is to install Oracle developer see if the same TNSNAMES.ORA file can connect to Oracle without VS2008 or 2010  because if you can browse Oracle database including tables with Oracle developer then you need to check you connection property in advanced to see what is the reason for your problem.  I would also say I use the x86 client but build AnyCPU.

    http://www.oracle.com/technology/products/database/sql_developer/index.html


    MCPD Web C#, MCTS TFS, MCITP BI and DBA
    Wednesday, May 26, 2010 3:12 PM
    Moderator
  • Thanks Caddre, i installed x86 client and now i can modify my xsd's inside visual studio. I can debug my application (web app.) with visual studio and using ASP.net developer server. However when i publish my web page(in the same computer) and try to execute my application i am still facing the same problem. Can it be because IIS is an x64 application while visual studio is x86 application?
    Thursday, May 27, 2010 12:42 PM
  • In Windows 7 that is not a problem because you could just run this application as x86 until Oracle provides a fix, I will look for the code you need and post back I am an Asp.net implimentation expert so just keep using the development server I will get back to you.
    MCPD Web C#, MCTS TFS, MCITP BI and DBA
    Thursday, May 27, 2010 1:13 PM
    Moderator
  • The first link is how you define x86 application pool and the second link is the defined folder permissions in IIS7 and up.  If you define those permissions I think you could run AnyCPU code in Windows 7 using Oracle 11g because we ran AnyCPU code using both 9i and 10g.

    http://blogs.msdn.com/b/rakkimk/archive/2007/11/03/iis7-running-32-bit-and-64-bit-asp-net-versions-at-the-same-time-on-different-worker-processes.aspx

    http://support.microsoft.com/?kbid=981949


    MCPD Web C#, MCTS TFS, MCITP BI and DBA
    Thursday, May 27, 2010 1:47 PM
    Moderator
  • My default application pool is already 32bit enabled. And the permission looks the same as the link says. Actually the first link says the default value for enabling 32 bit is false however in my computer it is true by default. But in task manager there is no process named w3wp.exe
    Thursday, May 27, 2010 3:10 PM
  • My default application pool is already 32bit enabled. And the permission looks the same as the link says. Actually the first link says the default value for enabling 32 bit is false however in my computer it is true by default. But in task manager there is no process named w3wp.exe

    I think it is the application pool permissions because if it is running in development server then it is file permissions, so right click on the application in IIS 7.5 go to basic settings in the physical path change to use specific account and supply password.  Then test it make sure this account is in your TNSNAMES.ORA file, and the development folder and the physical path in IIS 7.5 definition of your application. 
    MCPD Web C#, MCTS TFS, MCITP BI and DBA
    Thursday, May 27, 2010 6:42 PM
    Moderator
  • Great news, my application now works without any exceptions when i publish to IIS using the specific account and password on my development computer(windows 7 x64, IIS7). However when i publish it to the server (windows 2008 server x64, IIS 7) it still raises the same exception (badimageformatException). I tried to specify a user and password (administrator and its pass) like i did on my computer, but it still does not work.
    Friday, May 28, 2010 8:54 AM
  • Great news, my application now works without any exceptions when i publish to IIS using the specific account and password on my development computer(windows 7 x64, IIS7). However when i publish it to the server (windows 2008 server x64, IIS 7) it still raises the same exception (badimageformatException). I tried to specify a user and password (administrator and its pass) like i did on my computer, but it still does not work.

    I know the reason your development box is running IIS 7.5 while Windows 2008 if it is not R2 runs IIS 7 there is some deployment differences I will get back to you with the difference fix.  I am also running Windows 7 that is how I know the pass through permission never works.
    MCPD Web C#, MCTS TFS, MCITP BI and DBA
    Friday, May 28, 2010 12:32 PM
    Moderator
  • I have found the reason for your problem there is some setting in IIS7 that is not in IIS7.5 because in IIS7 if you right click on your application pool name and go to advanced setting you need to set enable 32bit application to true.  And the link below covers application pool identities.


    http://learn.iis.net/page.aspx/624/application-pool-identities/


    MCPD Web C#, MCTS TFS, MCITP BI and DBA
    Friday, May 28, 2010 2:00 PM
    Moderator
  • In this version of server 2008, there are no identities called ApplicationPoolIdentity, the identity is network service. However when i changed the Load user profile property in the advanced settings of the application pool to true, it worked. I hope this is not a harmful change :)

    Thank you so much caddre

    Friday, May 28, 2010 2:51 PM
  • In this version of server 2008, there are no identities called ApplicationPoolIdentity, the identity is network service. However when i changed the Load user profile property in the advanced settings of the application pool to true, it worked. I hope this is not a harmful change :)

    Thank you so much caddre


    This problem is long known Oracle connection problem it was fixed but IIS 7 and 7.5 have moved the folder so it is back, here are alternative ways to fix it.  The LoadUserProfile property is a boolean the link covers disabling it, I would not disable it if it will break the code.  And I am glad I could help.

    http://blogs.iis.net/bills/archive/2006/10/18/loadUserProfile-and-IIS7-_2D00_-understanding-temporary-directory-failures.aspx


    MCPD Web C#, MCTS TFS, MCITP BI and DBA
    Friday, May 28, 2010 5:08 PM
    Moderator
  • Hello,

    I get the same problem right now, with SSIS package connecting an Oracle 11g. I develop and build my SSIS package using VS2008 with "Default" active solution platform (I am not able to configure it, don't know why). It works fine on my development machine, but when I try to deploy it to a Win 2008 x64 server + Oracle 64 bit client (10.2.04), it fails validation with this BadImageFormatException exception. (ODBC works fine though)

    Any idea is highly appreciated.

    Allan

    Wednesday, June 9, 2010 2:34 PM
  • Hello,

    I get the same problem right now, with SSIS package connecting an Oracle 11g. I develop and build my SSIS package using VS2008 with "Default" active solution platform (I am not able to configure it, don't know why). It works fine on my development machine, but when I try to deploy it to a Win 2008 x64 server + Oracle 64 bit client (10.2.04), it fails validation with this BadImageFormatException exception. (ODBC works fine though)

    Any idea is highly appreciated.

    Allan


    Hi Allan,

    If you need to deploy in Oracle 10g I think you need to develop with 10g client and not 11g client, if I remember correctly you also need both x86 and x64 Oracle 10g client installed in Windows 2008 x64.  The other option is to develop in x86 build the package and deploy in x64.  I also think you need to add the TNSNAMES.ORA file in the folder you installed the Oracle client which installs in D drive.

    VS2008 without build option could be BIDS(business intelligence development studio) because if you are running VS2008 Team Suites or the database developer edition both comes with build options.


    MCPD Web C#, MCTS TFS, MCITP BI and DBA
    Thursday, June 10, 2010 12:38 AM
    Moderator
  • Thanks Caddre,

    If I install x86 Oracle 10g client, I get the error "ORA-12154: TNS:could not resolve the connect identifier specified". I do have TNSNAMES.ORA file in the "Oracle home\NETWORK\ADMIN" folder, and my connection string in SSIS package is "ip/service name".

    Regards,

    Allan

    Thursday, June 10, 2010 1:40 PM
  • Thanks Caddre,

    If I install x86 Oracle 10g client, I get the error "ORA-12154: TNS:could not resolve the connect identifier specified". I do have TNSNAMES.ORA file in the "Oracle home\NETWORK\ADMIN" folder, and my connection string in SSIS package is "ip/service name".

    Regards,

    Allan


    Allan,

    TNS not resolved is a permissions error which relates to location of the TNSNAMES.ORA file relative to where you are developing, you need to create a development folder and add that file and Oracle client in the development folder.  The first thing you do is get Oracle SQL developer install it to see if you can connect to Oracle and browse the database and tables with the same TNSNAMES.ORA file.

    The reason Oracle home folder is not being accessed by SSIS which is an issue.


    MCPD Web C#, MCTS TFS, MCITP BI and DBA
    Thursday, June 10, 2010 2:02 PM
    Moderator
  • Yes, SQL Developer is able to connect and browse the DB properly without changing anything in the client.

    Thanks again.

    Allan

    Thursday, June 10, 2010 2:35 PM
  • Yes, SQL Developer is able to connect and browse the DB properly without changing anything in the client.

    Thanks again.

    Allan


    Hi Allan,

    If you are in SQL Server 2008 and VS2008 the third party RDBMS are defined in Intergrated services connection project at least in VS2008 Team Suites, however here is the steps to use Oracle in x64 box.  I still think you need to move the Oracle home to your development folder so you can have the TNSNAMES.ORA file in the same folder.

    http://subhashsubramanyam.blogspot.com/2007/04/workaround-for-oracle-connectivity.html

     


    MCPD Web C#, MCTS TFS, MCITP BI and DBA
    Thursday, June 10, 2010 5:39 PM
    Moderator
  • Solved. Installing 11g (instead of 10g) 32-bit client solves the problem. Thanks.
    Friday, June 11, 2010 5:27 PM
  • Solved. Installing 11g (instead of 10g) 32-bit client solves the problem. Thanks.


    Hi Allan,

    It took this long for me to reply because I got your reply in the mail but it just showed up in the thread this morning.  Thanks for posting the solution because I think 11g worked instead of 10g because of the SQL Server version and Visual Studio version Oracle builds client for Visual Studio.  So the 11g client is for VS2008. 

     

     


    MCPD Web C#, MCTS TFS, MCITP BI and DBA
    Saturday, June 12, 2010 2:19 PM
    Moderator
  • I have to have both Oracle Client 10g x64 and x86 installed on my servers because of some other applications mostly.  For Win 2003 and 2008 and both 10g and 11g I always install Oracle Client x64 first, then install x86.  If you need ODAC this comes next.  You should also make sure that x64 then x86 is in the 'Path' variable (ie C:\oracle\client_1\bin, C:\oracle\client_2\bin.  Oracle_home system variable should also be set but only to the root of the x86 location.  Hope this helps.

    Thursday, September 2, 2010 7:47 PM
  • this problem happens becouse you must change your project to run it in a x86 CPU, you can still use the System.Data.OracleClient to connect to Oracle 10 or later. If you have any problem whit the Oracle client in your server, you can download and install the ODP.NET from oracle.com, follow the instructions to setup it and ready .
    It Director
    Thursday, October 7, 2010 10:13 PM
  • Hi,

    I m facing the same issue of BADIAMGE error, i have 64bit server and 64 bit oracle client is only installed.

     

    Message : Attempt to load Oracle client libraries threw BadImageFormatException.  This problem will occur when running in 64 bit mode with the 32 bit Oracle client components installed.

    The application which is connecting to oracle is windows application (So no IIS setting needed). VS2010 is IDE.

     

    Also if you can tell me how to identify whether 32bit of 64bit drivers are installed for oracle????

    Wednesday, December 1, 2010 1:35 PM
  • Hey AnantAnandGupta,

    Did you solve that?? I'm facing this same problem..

    Please let me know if you have a solution.

    Thanks

    Friday, December 10, 2010 3:29 AM
  • Hey AnantAnandGupta,

    Did you solve that?? I'm facing this same problem..

    Please let me know if you have a solution.

    Thanks


    Here is the link to download both x86 and x64 clients for Oracle 11g I think you need to download and install both, then make sure the TNSNAME.ORA file is added to Oracle home folder with the relevant Oracle permissions for the application.

    http://www.oracle.com/technetwork/database/enterprise-edition/downloads/index.html


    MCPD Web C#, MCTS TFS, MCITP BI and DBA
    Friday, December 10, 2010 4:13 PM
    Moderator
  • Hi Everyone,

    I read the entire thread and I am still unsure what to do.

    I have installed Oracle 11G x64 and has been trying to connect using Microsoft Visual Studio.

    I know my Oracle works perfectly because I could connect the database using sqlplus to create an account and I was able to connect to it using SQL developer.

    The problem I am having right now is when I try to connect using Microsoft Visual Studio, it says "Attempt to load Oracle client libraries threw BadImageFormatException. This problem will occur when running in 64 bit mode with the 32 bit Oracle client components installed."

    I am unsure whether I am running the x64 version of Microsoft Visual Studio, and I am really unsure what I can do. Please advise.

    I read in the thread that installing 11G x86 along with my x64 would solve the problem. Do I really need to install that? Also, what does it mean by "make sure the TNSNAME.ORA file is added to Oracle home folder with the relevant Oracle permissions for the application." As far as I know, I didn't configure anything about TNSNAME.ORA to get my server up and running. Am I doing something wrong?

     

    Thanks in advanced

    Friday, December 24, 2010 6:49 AM
  • I know my Oracle works perfectly because I could connect the database using sqlplus to create an account and I was able to connect to it using SQL developer.

    Connecting to Oracle with SQL Plus is generally not relevant to Microsoft development.

    The problem I am having right now is when I try to connect using Microsoft Visual Studio, it says "Attempt to load Oracle client libraries threw BadImageFormatException. This problem will occur when running in 64 bit mode with the 32 bit Oracle client components installed."

    I am unsure whether I am running the x64 version of Microsoft Visual Studio, and I am really unsure what I can do. Please advise.

    There is no x64 Visual Studio only x86 which can be used to develop x64 applications that is the reason for the above exception.

    I read in the thread that installing 11G x86 along with my x64 would solve the problem. Do I really need to install that? Also, what does it mean by "make sure the TNSNAME.ORA file is added to Oracle home folder with the relevant Oracle permissions for the application." As far as I know, I didn't configure anything about TNSNAME.ORA to get my server up and running. Am I doing something wrong? 

    The reason you need the x86 Oracle client is because the Oracle client is required for development and Visual Studio is x86 so you need x86 Oracle client to resolve compatibility issues.  Now I don't understand why you did not use a TNSNAMES.ORA file because like the Oracle client TNSNAMES.ORA is also required for Oracle development.  Oracle querying and development are not related so you either create a TNSNAMES.ORA file if you have the permissions or ask your systems people for a copy because it contains permissions and other connection related information that Visual Studio will use to connect to Oracle.  Post again if you still need help.


    MCPD Web C#, MCTS TFS, MCITP BI and DBA
    Friday, December 24, 2010 5:17 PM
    Moderator
  • Thank you for your reply. I just installed the x86 version now.

     

    Now I get the error.

    ORA-12557: TNS:protocol adapter not loadable.

     

    I checked online and it says it is because I have two oracle version installed.

     

    Should I uninstall the x64 version? Right now, it is giving me another error:

    Friday, December 24, 2010 7:54 PM
  • Thank you for your reply. I just installed the x86 version now.

     

    Now I get the error.

    ORA-12557: TNS:protocol adapter not loadable.

     

    I checked online and it says it is because I have two oracle version installed.

     

    Should I uninstall the x64 version? Right now, it is giving me another error:


    There is some confusion here two Oracle home does not mean two versions of Oracle because Oracle installer can create more than one Oracle home if you are not watching the Oracle installer.  You need to remove one of the Oracle home which can get tricky because Oracle installer is not flexible, so remove the Oracle home created by the x64 install and install the x86 client.  You also did not say anything about the TNSNAMES.ORA file you need that in the home folder before starting Visual Studio.  Check the link below for your error reference.

    http://arjudba.blogspot.com/2009/01/ora-12557-tnsprotocol-adapter-not.html


    MCPD Web C#, MCTS TFS, MCITP BI and DBA
    Friday, December 24, 2010 8:44 PM
    Moderator
  • Okay, I reinstalled a fresh copy of x64. Now, the error is now gone. I also went online and researched how to configure TNSNAMES.ORA, listener.ora, and SQLNET.ORA. I created them in the C:\Oracle\product\11.2.0\dbhome_1\NETWORK\ADMIN

     

    When i start the lsnrctl, I get this line that says "The listener supports no services"

     

    C:\Users\JC>lsnrctl start


    LSNRCTL for 32-bit Windows: Version 11.2.0.1.0 - Production on 24-DEC-2010 17:43

    :35


    Copyright (c) 1991, 2010, Oracle.  All rights reserved.


    Starting tnslsnr: please wait...


    TNSLSNR for 32-bit Windows: Version 11.2.0.1.0 - Production

    System parameter file is C:\Oracle\product\11.2.0\dbhome_1\network\admin\listene

    r.ora

    Log messages written to c:\oracle\diag\tnslsnr\JC-PC\listener\alert\log.xml

    Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=1521)))


    Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=127.0.0.1)(PORT=1521)))

    STATUS of the LISTENER

    ------------------------

    Alias                     LISTENER

    Version                   TNSLSNR for 32-bit Windows: Version 11.2.0.1.0 - Produ

    ction

    Start Date                24-DEC-2010 17:43:40

    Uptime                    0 days 0 hr. 0 min. 5 sec

    Trace Level               off

    Security                  ON: Local OS Authentication

    SNMP                      OFF

    Listener Parameter File   C:\Oracle\product\11.2.0\dbhome_1\network\admin\listen

    er.ora

    Listener Log File         c:\oracle\diag\tnslsnr\JC-PC\listener\alert\log.xml

    Listening Endpoints Summary...

      (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=1521)))

    The listener supports no services

    The command completed successfully

     

     

    Also, when I try to test the oracle sql connection in the Visual Studio 2010, I get "ORA-12154: TNS:could not resolve the connect identifier specified"

     

    I have no idea whether my configuration is correct or not. Can you please help? Thanks.

     

    TNSNAMES.ORA:

    db =

     (DESCRIPTION = 

       (ADDRESS_LIST =

         (ADDRESS = (PROTOCOL = TCP)(HOST = 127.0.0.1)(PORT = 1521))

       )

     (CONNECT_DATA =

       (SERVICE_NAME = db)

     )

    )

     

     

    listener.ora:

    LISTENER =

      (DESCRIPTION_LIST =

        (DESCRIPTION =

          (ADDRESS = (PROTOCOL = TCP)(HOST = 127.0.0.1)(PORT = 1521))

        )

      )

     

    SQLNET.ORA:

    NAMES.DIRECTORY_PATH= (TNSNAMES)

    NAMES.DEFAULT_DOMAIN = db

    TRACE_LEVEL_CLIENT = OFF

    SQLNET.EXPIRE_TIME = 30

     

     

    I also want to thank you for helping me thus far. Setting up Oracle is such a pain...

    Friday, December 24, 2010 10:54 PM
  • C:\Users\JC>lsnrctl start


    LSNRCTL for 32-bit Windows: Version 11.2.0.1.0 - Production on 24-DEC-2010 17:43

    :35


    Also, when I try to test the oracle sql connection in the Visual Studio 2010, I get "ORA-12154: TNS:could not resolve the connect identifier specified"
    I have no idea whether my configuration is correct or not. Can you please help? Thanks.

    TNSNames not resolved means it is permissions related so you need to add the account used to connect to Oracle in the Oracle home folder permissions.  I also don't understand why you are using the x64 client when your operating system is x86 because most Oracle are x64 but because Visual Studio is x86 it is better to use the x86 client.

     


    MCPD Web C#, MCTS TFS, MCITP BI and DBA
    Saturday, December 25, 2010 12:38 AM
    Moderator
  • Do I add the permission using Oracle Administration Assistant? I opened that and it says

     

    MMC could not create the snap-in.  The snap-in might not have been installed correctly.

    Name: Oracle Primary MMC Snap-In.

    CLSID: {50D06DC1-CFFE-11D1-8271-00C04FD945C7}

     

    So I went to File -> Add/Remove Snap-in

    It says

    MMC cannot initialize the snap-in.

    Name: Oracle Performance Monitoring MMC Snap-In

    CLSID: {03E37506-6325-11D2-B313-00805FC19E2E}

     

    Clicked Ok then.

    MMC cannot initialize the snap-in.

    Name: Oracle HOme Configuration MMC Snap-In

    CLSID: {A6A79880-6384-11D2-B313-00805FC19E2E}

     

    Clicked Ok then.

    MMC cannot initialize the snap-in.

    Name: Oracle Administration Assistant MMC Snap-In

    CLSID: {F93E8EF3-11D4-11D2-B9C2-00C04FD945C7}

     

    Then the screen loaded and I went down and selected Oracle Primary MMC Snap-In and then click Add ->

     

    MMC cannot initialize the snap-in.

    Name: Oracle Primary MMC Snap-In

    CLSID: {50D06DC1-CFFE-11D1-8271-00C04FD945C7}

     

     

    Saturday, December 25, 2010 8:08 AM
  • No actually you right click on the Oracle home folder and give the account you used to connect to Oracle read and right permission on the folder.  Try connecting to Oracle with SQL Developer again see if you can browse objects.
    MCPD Web C#, MCTS TFS, MCITP BI and DBA
    Saturday, December 25, 2010 4:42 PM
    Moderator
  • Wow, yes I can browse the objects using SQL Developer. But when I try to connect using the Microsoft Visual Studio, I am getting "another" error *sigh...

     

    ORA-12514: TNS:listener does not currently know of service requested in connect descriptor.

     

    I spent the entire christmas afternoon googling it. No luck.

     

    I found this site though

    http://www.orafaq.com/forum/t/96146/2/

     

    But I have no idea what they meant by "Sorry my bad about service name did't cahnge it back after making a change it to SID,about local listener i specified it this morning need to bounce the db,do you think that should fix it?"

    Sunday, December 26, 2010 1:59 AM
  • Thanks so much Caddre!

     

    Everything works now. I reconfigured all the .ora files. and it works now. Thank you for all your time. You are the best!

    Sunday, December 26, 2010 3:40 AM
  • Thanks so much Caddre!

     

    Everything works now. I reconfigured all the .ora files. and it works now. Thank you for all your time. You are the best!


    I am glad I could help, happy holidays.
    MCPD Web C#, MCTS TFS, MCITP BI and DBA
    Sunday, December 26, 2010 5:17 PM
    Moderator
  • hello everyone

     I get the below error when I try to connect to ORACLE from BIDS 2008 SSRS. The data source type I created is Oracle and the connection string I gave is Data Source=XXXXX;Unicode=True  When I hit test connection I get the error. I am using Windows 7 64 bit machine.

    "Attempt to load Oracle client libraries threw BadImageFormatException. This problem will occur when running in 64 bit mode with the 32 bit Oracle client components installed."

    I need to create SSRS reports by connecting to ORACLE db. Is this problem because of Windows 7 machine? Is Oracle 11g supported by BIDS 2008 R2?

    Tuesday, April 5, 2011 9:14 PM
  • Hi, i had the same issue with Win 7 (x64) and VS 2010.

    I installed Oracle client 11g (both 32 bit and 64 bit) and built my app for 'any CPU'. Issue got resolved.

    Thanks,

    Rajesh K.

    • Proposed as answer by TarMAc Thursday, September 8, 2011 9:27 AM
    • Unproposed as answer by TarMAc Thursday, September 8, 2011 9:59 AM
    Wednesday, July 27, 2011 6:59 PM
  • Had same problem.  I resolved it by

    1.) Unistalling all Oracle Clients I tried thas far.Clean registry. Restarted server.

    2.) Installed Oracle Client 11g DAC 11.2.0.1

    3.) Configure environment variable ie. ORACLE_HOME to point to oracle client installation, in my case C:\OracleBase

    4.) Configure tnsname.ora file

    5.) Restarted server.

    6.) Set ApplicationPool to enable 32 apps (IIS > ApplicationPools > Right on AppPool - Click Advandced Settings - Set "Enable 32-bit Applications=true)

     

    I do not know why I needed to restart the server after I changed tnsnames.ora but prior to restarting it did not work. Once restarted it recognised the configs.

    My next step will be to get another VM server working using the Oracle 10g Client 64-bit.

     

    THANKS Caddre. I saw your answer and it helped fix mine.

     


    TarMac

    • Edited by TarMAc Thursday, September 8, 2011 9:59 AM
    Thursday, September 8, 2011 9:37 AM
  •  

    its help me great .

     

    Thanks&Regards

    Muhammad Abdul Halim

    http://halimdba.blogspot.com/

    Saturday, November 19, 2011 5:59 AM
  • This worked for me ...

    But my app to work i had to make it 32 bit app as suggested by SIRRMA R. in this post:

    "While you wait for 64-bit client, you can try  recompiling your application as x86 would make the application work. (assuming that you have a 32-bit oracle client installed on x64 box)... This would make the app work as a 32-bit app, though.."

    Thanks to both of you!

    After making you app 32bit you might get PageHandlerFactory-ISAPI-4.0_32bit error.  IIS 7.5 gives you direction to fix it but if you do not get here is the copy of the soluation:

     

    Detailed Error Information

     

    Module

    IsapiModule

    Notification

    ExecuteRequestHandler

    Handler

    PageHandlerFactory-ISAPI-4.0_32bit

    Error Code

    0x800704ec

    Requested URL

    http://localhost:80/DMS/UI/Menu.aspx

    Physical Path

    C:\Projects\DMS\DMS\UI\Menu.aspx

    Logon Method

    Anonymous

    Logon User

    Anonymous

     

    Most likely causes:

    • No handler mapping for this request was found. A feature may have to be installed.
    • The Web service extension for the requested resource is not enabled on the server.
    • The mapping for the extension points to the incorrect location.
    • The extension was misspelled in the browser or the Web server.

    Things you can try:

    • Install the feature that handles this request. For example, if you get this error for an .ASPX page, you may have to install ASP.NET via IIS setup.
    • Verify that the Web service extension requested is enabled on the server.
      1. Open the IIS Manager and navigate to the server level.
      2. In the Features view, double-click ISAPI and CGI Restrictions to verify that the Web service extension is set to Allowed.
      3. If the extension is not in the list, click Add in the Actions pane.
      1. In the Add ISAPI and CGI Restrictions dialog box, type the path of the .dll or .exe file in the ISAPI or CGI Path box, or click Browse to navigate to the location of the file.
      1. In the Description box, type a brief description of the restriction.
      2. (Optional) Check "Allow extension path to execute" to allow the restriction to run automatically. If you do not check this option, the restriction status is Not Allowed, which is the default. You can allow the restriction later by selecting it and clicking Allow on the Actions pane.
      3. Click OK.
        NOTE: Make sure that this Web service extension or CGI is needed for your Web server before adding it to the list. 

     



    • Edited by Deep Thursday, January 19, 2012 7:28 PM
    Thursday, January 19, 2012 7:18 PM
  • I was getting the same error in my ULS logs(Sharepoint wouldn't elaborate on what the error was):

    System.BadImageFormatException: An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)    at System.Data.Common.UnsafeNativeMethods.OCILobCopy2(IntPtr svchp, IntPtr errhp, IntPtr dst_locp, IntPtr src_locp, UInt64 amount, UInt64 dst_offset, UInt64 src_offset)     at System.Data.OracleClient.OCI.DetermineClientVersion()

    I installed 64bit Oracle client along with the 32 bit version I already had on the production server, altough it didn't fix it and I don't think I needed to(Since it wasn't on my development server which works).

    Eventually I resolved the problem my simply adding "TNS_ADMIN", with the path to "tnsnames.ora", to the windows system environment variables.

    Thursday, June 7, 2012 12:11 PM
  • I had same Issue... What I found that wrong version of Oci.dll was in my application folder ... So I deleted it and it started working. Application was loading local dll rather than picking up right dll from Oracle Client Installation Directory.... So make sure If you are distributing oci.dll then its correct processor architecture (x86, x64).... OLEDB and ADO.net driver for Oracle uses Oci.dll behind the scene.

    My Blog | Convert DTS to SSIS | Document SSIS | SSIS Tasks | Real-time SSIS Monitoring

    Friday, August 17, 2012 4:05 PM
  • thanks for this suggest > it works well 


    Monday, December 24, 2012 12:30 PM