I made c# asp.net web applciation with oracle 10g database using visual studio 2008. It works fine with local environment. After I published on my web server and received the following error:

*Could not load file or assembly 'Oracle.DataAccess, Version=10.2.0.100, Culture=neutral, PublicKeyToken=89b483f429c47342' or one of its dependencies. The system cannot find the file specified. *

I put Oracle.DataAccess.dll directly into my application bin and add reference from bin and publish the apps. I received the following error:

*Unable to load DLL 'OraOps10.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E) *

I put OraOps10.dill into my application bin and tried to add reference but visual studio didn't allow to add it.

A reference to OraOps10.dll could not be added. Please make sure that the file is accessible, and that it is a valid assembly or COM component.

I researched a lot about this issue and get confused.
Do I have to install whole oracle client into my web server in order to run my application on the web?

I appliciate
p.s. I am using free asp.net web hosting service and I cannot install oracle client on the server.

I would appreciate if anyone can help me.

Regards,

Dani AI

Generated

the two errors show your site is loading ODP.NET Unmanaged (Oracle.DataAccess 10g). That provider depends on Oracle Client native DLLs (OCI). Copying only Oracle.DataAccess.dll makes the first native dependency (OraOps10.dll) fail. Unmanaged ODP.NET looks for those DLLs in the app directory, the DllPath setting, and then PATH, and the client bitness/version must match your app pool. In short: without an Oracle Client (or Instant Client) available to IIS, it will not run. See Oracle’s notes on driver types and DLL search order. ODP.NET driver types. Unmanaged ODP.NET DLL search order and DllPath. DllPath config.

Because you are on free hosting (no installs), the practical workaround is to switch to the managed provider, which is xcopy-deployable and requires no Oracle Client. It needs .NET Framework 4 or later, so you would retarget the site (VS 2010+), add the NuGet package Oracle.ManagedDataAccess, and update your usings/connection. Install ODP.NET, Managed Driver. .NET 4+ requirement.

Example with Easy Connect so you do not need tnsnames.ora:

using Oracle.ManagedDataAccess.Client;

var cs = "User Id=scott;Password=tiger;Data Source=//your-host:1521/yourservice";
using var con = new OracleConnection(cs);
con.Open();

If you must stay on .NET 3.5/VS2008 as noted, you will need a host that provides Oracle Client, or one that lets you deploy Instant Client and load native DLLs. In that case set DllPath to where you xcopy the client, ensure full trust, and match 32/64-bit:

<configuration>
  <oracle.dataaccess.client>
    <settings>
      <add name="DllPath" value="C:\inetpub\wwwroot\yourapp\oracle\bin"/>
    </settings>
  </oracle.dataaccess.client>
</configuration>

Easy Connect details: ODP.NET connection options.

Recommended Answers

All 2 Replies

Do I have to install whole oracle client into my web server in order to run my application on the web?

Yes. I don't think just copying assemblies will work.

Thank you for your reply.I will check with other package plan or look for new hosting service who already has oracle client installed. What only I wanted to do was to try if I can connect my home db from my web apps. If anybody know non expensive hosting service, please give me the the name.

Thank you.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.