0

I am trying to change existing c# code using StackService.ORMLite (Ver: ) from SQL Server to Oracle. I have made all the required changes as suggested. Now I am stuck with the issue "Unable to find the requested .Net Framework Data Provider. It may not be installed."

var db = new OrmLiteConnectionFactory(AppSettingsHelper.TryGetValue(ConfigKeys.ContentLoaderDataBase, default(string)), OracleDialect.Provider);
        FunqContainer.Register<IDbConnectionFactory>(db);
        FunqContainer.Register<IContentLoaderRepository>(c => new ContentLoaderRepository(db));
        FunqContainer.RegisterAutoWiredAs<HttpRequestor, IHttpRequestor>();
        FunqContainer.RegisterAutoWiredAs<Transformer, ITransformer>();
        FunqContainer.RegisterAutoWiredAs<WKH.MR.ContentLoader.Agent.XmlSerializer, IXmlSerializer>();
        FunqContainer.RegisterAutoWiredAs<WKH.MR.ContentLoader.Agent.FieldParser, IFieldParser>();

I am using ODP.Net provider ver: 4.112.3.0 and included Oracle.DataAccess reference into the project. During runtime while opening db connection it is throwing exception "Unable to find the requested .Net Framework Data Provider. It may not be installed.". What might be the issue?

Gray
  • 108,756
  • 21
  • 270
  • 333
SomM
  • 1
  • 2
  • How did you install ODP.NET? Oracle client tools are *notorious* for their complex installation (eg [see here](http://stackoverflow.com/questions/13721025/deploying-and-configuring-odp-net-to-work-without-installation-with-entity-frame)). Did you use Oracle's NuGet package, followed the instructions in the zip file or simply added a reference to the project? – Panagiotis Kanavos Mar 24 '15 at 09:34

1 Answers1

2

Assuming your ODP config is:

<connectionStrings>
    <add name="yourconfig" providerName="Oracle.DataAccess.Client"
connectionString="Data Source=(..);User Id=..." />

You just need :
1. add "Oracle.DataAccess.dll" file to your application references
(usually path :

%ORACLE_HOME%\product\..\ODP.NET\bin\{version}\Oracle.DataAccess.dll

2.ADD two section under your web.config
2.1 under "configuration \ configSections"

<section name="oracle.dataaccess.client"    
    type="System.Data.Common.DbProviderConfigurationHandler, System.Data,Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>    

2.2 under "system.data\DbProviderFactories" (create it if not existed)

<remove invariant="Oracle.DataAccess.Client" />    
  <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={your version}, Culture=neutral, PublicKeyToken=89b483f429c47342"/>    

I fixed the same problem as yours. Remember to ensure versions the same, i.e "Version={version}" same as dll file version Good luck!

BTW:I recommand this post help to resolve Oracle Connection Issue Oralce Data Provider for .net, which save me a lot of time.
ServiceStack is Great,ORMLite is under great team I hope it will help someone using Oralce (client damned)

Community
  • 1
  • 1
Tearf001
  • 31
  • 6