Diagnostics: x64, ODP.net and "Unable to find ... Data Provider"

by Kevin Goff 19. October 2009 21:53

Diagnostics: x64, ODP.net and "Unable to find ... Data Provider"

I came across a problem today on our x64 (extended 64 bit) servers when troubleshooting an Oracle installation. We completed the installation of the ODP.net Oracle client and setup as we normally do on our x86 machines but this time there was a problem: we weren't connecting to Oracle. I started diagnosing the problem using the typical techniques -- google the exception text. But -- no joy. There only 3 other articles that contained similar texts but none of them seemed to be pointing towards Oracle or x64. Now I knew I was in for some fun diagnosing.

Before I go to much further let me summarize the problem. First of all the error message, "Unable to find the requested .Net Framework Data Provider. It may not be installed.".

Next is the environment:

  • Running x64 machines in IIS 32bit mode.
  • We were using VS 2005, .net 2.0 runtime
  • ODP.net 10
  • Microsoft Enterprise Library - January 2006 version.

 

After trying several different typical fixes I realized I needed to start from scratch -- create a basic web app that hits oracle through ODP and see if it works. DING! The test project worked fine. So now what? Oracle works, IIS works, that pretty much leaves the Enterprise Library. After digging in to the guts of the how the Enterprise Library works I discovered that the installation process of the Oracle ODP client requires a little snip added to the machine.config. Further investigation found that Oracle did update the machine.config of the Framework64 directory but not the 32bit directory. AHA!

The solution: edit the machine.config (Located at C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\CONFIG\machine.config) and add the missing piece. The Enterprise Library needs this piece to function. (the piece that was missing for our configuration is listed in blue below)

 

C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\CONFIG\machine.config
  1. ...
  2. <system.data>
  3.   <DbProviderFactories>
  4.     <add name="Odbc Data Provider" invariant="System.Data.Odbc" description=".Net Framework Data Provider for Odbc" type="System.Data.Odbc.OdbcFactory, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
  5.     <add name="OleDb Data Provider" invariant="System.Data.OleDb" description=".Net Framework Data Provider for OleDb" type="System.Data.OleDb.OleDbFactory, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
  6.     <add name="OracleClient Data Provider" invariant="System.Data.OracleClient" description=".Net Framework Data Provider for Oracle" type="System.Data.OracleClient.OracleClientFactory, System.Data.OracleClient, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
  7.     <add name="SqlClient Data Provider" invariant="System.Data.SqlClient" description=".Net Framework Data Provider for SqlServer" type="System.Data.SqlClient.SqlClientFactory, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
  8.     <add name="SQL Server CE Data Provider" invariant="Microsoft.SqlServerCe.Client" description=".NET Framework Data Provider for Microsoft SQL Server 2005 Mobile Edition" type="Microsoft.SqlServerCe.Client.SqlCeClientFactory, Microsoft.SqlServerCe.Client, Version=9.0.242.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" />
  9.     <add name="Oracle Data Provider for .NET" invariant="Oracle.DataAccess.Client" description="Oracle Data Provider for .NET" type="Oracle.DataAccess.Client.OracleClientFactory, Oracle.DataAccess, Version=2.102.2.20, Culture=neutral, PublicKeyToken=89b483f429c47342" />
  10.   </DbProviderFactories>
  11. </system.data>
  12. ...

 

Tags: , , ,

.NET Development

Comments

6/8/2010 2:59:05 PM #

Led plant lights

Thanks for the  post on Oracle installation. You made some goos point here. I really appreciate your work.

Led plant lights United States | Reply

6/18/2010 2:17:27 PM #

gagner de l'argent facile au casino en ligne

It helped me with ocean of knowledge so I really believe you will do much better in the future I appreciate everything you have added to my knowledge base.Admiring the time and effort you put into your blog and detailed information you offer!

gagner de l'argent facile au casino en ligne India | Reply

6/24/2010 5:35:17 PM #

online payday advance

When you come to a roadblock, take a detour.

online payday advance United States | Reply

6/25/2010 5:17:48 PM #

Leslie Wilson

Very thanks for great code. It helped me with ocean of knowledge so I really believe you will do much better in the future I appreciate everything you have added to my knowledge base.Admiring the time and effort you put into your blog and detailed information you offer!

Leslie Wilson United States | Reply

7/11/2010 9:05:11 AM #

same day loans

Each friend represents a world in us, a world possibly not born until they arrive, and it's only by this meeting that a new world is born. http://www.clicknpayday.com

same day loans United States | Reply

7/14/2010 6:31:00 AM #

data match         

Good article...I will use some of these interesting principles myself...more great info please...

data match       United States | Reply

7/15/2010 2:57:41 PM #

Royquener

Very thanks!!!

Royquener Brazil | Reply

7/17/2010 6:27:27 PM #

Rosacea

Thanks for the solution, I thought it might have something to do with config, but you have solved it

Rosacea United Kingdom | Reply

7/29/2010 12:08:20 PM #

online casinos

A provider is responsible for connecting to a specific database. Why specific? The reason is that a provider for an Oracle database cannot be used to connect to a SQL Server database and vice-versa. Next, you need a command object that can be used to execute the database commands of your choice.

online casinos India | Reply

Add comment




  Country flag

biuquote
  • Comment
  • Preview
Loading