ASP.Net Site not able to connect with Oracle Database when deployed on IIS 8.5. RRS feed

  • Question

  • User1107339809 posted

    Hello Team @ Microsoft,


    We are facing a very strange problem while we are trying to host an application over IIS. Let me explain this below :


    There is an application server where we are developing and deploying an ASP.NET application and a database server from where we will be fetching and dumping data from and to the database respectively.


    The Application Server configurations are as follows :

    • OS : Windows Server 2012 R2 (64 bit)
    • Microsoft .NET Framework : 4.5.51641
    • Microsoft Windows Server Version 6.2 (Build 9200)
    • Internet Information Services (Version 8.5.9600.16384)
    • Microsoft Visual Studio Premium 2013 Version 12.0.31101.00 Update 4
    • Oracle Database Client ( for Microsoft Windows (x64)
    • 32 bit ODAC (Oracle Data Access Components)12c Release 1


    The Database Server configurations are as follows :

    • OS : Redhat RHEL 7.1 x86_64 (64 bit)
    • Oracle Server : Oracle 12C R2 (64 bit)


    Now, we have configured the TNS entry of the client as per the details of the oracle server. When we run the code using (Cassini) in Visual Studio, the application is running properly without throwing any error. However, when we try to publish the website from Visual Studio and do a web deployment through IIS, the application page opens. However, during login, it fails. We have made several breakpoints to understand the problem. We could see that it failed when we called Open method of OracleConnection obeject.

    We are not able to understand why system is able to create connection to database when running with in Visual Studio but failed when deployed to IIS.  I have check in both cases system is using same connection string with valid credentials. 

    Can you please help us into this?  

    Tuesday, April 25, 2017 3:05 AM

All replies

  • User753101303 posted


    Detailed but the very first information that would help is the error message you have. You likely have multiple messages depending on what goes wrong during the initial connection and it would likely help someone familiar with Oracle (I'm using SQL Server) to narrow down the problem.

    Else for now it is just anything that could happen and we can just guess some kind of configuration or firewall issue. Please never post about an error without telling what it is exactly...

    Tuesday, April 25, 2017 8:58 AM
  • User1107339809 posted

    Hello PatriceSc,

    The following is the code which opens connection with the Oracle Database.

    Code to open connection with Oracle Database.

    When this is executed, an exception is thrown with the following details :

    Exception Errors

    Hope this helps.


    Tuesday, April 25, 2017 10:44 AM
  • User753101303 posted

    So it seems an Oracle level error and the numeric error translates to 80004005. Try perhaps http://stackoverflow.com/questions/20646800/oracleexception-0x80004005-when-connecting-to-oracle-database

    Is this expected to have ?

    Oracle Database Client ( for Microsoft Windows (x64)
    32 bit ODAC (Oracle Data Access Components)12c Release 1

    The rule is that if a process is 64 bit (you could use https://msdn.microsoft.com/en-us/library/system.environment.is64bitprocess(v=vs.110).aspx) then DLLs loaded by this process should be x64 as well...

    Tuesday, April 25, 2017 11:13 AM
  • User269602965 posted

    If you are using the 32-bit ODAC then you must install the 12cR1 32-bit client in a separate ORACLE HOME from your 64-bit client in the same Oracle Base directory.

    IIS must have 32-bit enabled (can't remember where that setting is)


    the application must be compiled explicitly 32-bit.

    The 32-bit ODAC client can communicate just fine with the 64-bit remote database server.


    it is good idea in application ENVIRONMENT to set up the ENVIRONMENT PARAMETERS FOR: ORACLE_BASE directory, ORACLE_HOME to your 32-bit Oracle Home, and in PATH have the Oracle 32-bit client FIRST.

    If you are working in NON-FIPS-140 enabled world, you can look into the Oracle MANAGED driver which is both 32-bit and 64-bit aware, not dependent on the GAC, AND has the Oracle Client built IN. No Oracle client installation required.  The CONFIG and IMPORTS statements are different, but all the CODE behind PAGE is the same.

    Tuesday, April 25, 2017 9:44 PM