Unable to find Data Provider error message

Unable to find Data Provider error message

Postby labate » Tue 12 Jun 2007 12:59

Hi,

When I publish my web service app on IIS I got the following message when I try to access the DB "Unable to find the requested .Net Framework Data Provider. It may not be installed." :
Code: Select all
[ArgumentException: Le fournisseur de données .Net Framework demandé est introuvable. Il n'est peut-être pas installé.]
   System.Data.Common.DbProviderFactories.GetFactory(String providerInvariantName) +1372055
   Microsoft.Practices.EnterpriseLibrary.Data.DatabaseConfigurationView.GetDefaultMapping(String name, String dbProviderName) +132
   Microsoft.Practices.EnterpriseLibrary.Data.DatabaseConfigurationView.GetProviderMapping(String name, String dbProviderName) +154
   Microsoft.Practices.EnterpriseLibrary.Data.DatabaseCustomFactory.CreateObject(IBuilderContext context, String name, IConfigurationSource configurationSource, ConfigurationReflectionCache reflectionCache) +135
   Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ObjectBuilder.ConfiguredObjectStrategy.BuildUp(IBuilderContext context, Type t, Object existing, String id) +162
   Microsoft.Practices.ObjectBuilder.BuilderStrategy.BuildUp(IBuilderContext context, Type typeToBuild, Object existing, String idToBuild) +93
   Microsoft.Practices.ObjectBuilder.SingletonStrategy.BuildUp(IBuilderContext context, Type typeToBuild, Object existing, String idToBuild) +235
   Microsoft.Practices.ObjectBuilder.BuilderStrategy.BuildUp(IBuilderContext context, Type typeToBuild, Object existing, String idToBuild) +93
   Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ObjectBuilder.ConfigurationNameMappingStrategy.BuildUp(IBuilderContext context, Type t, Object existing, String id) +186
   Microsoft.Practices.ObjectBuilder.BuilderBase`1.DoBuildUp(IReadWriteLocator locator, Type typeToBuild, String idToBuild, Object existing, PolicyList[] transientPolicies) +339
   Microsoft.Practices.ObjectBuilder.BuilderBase`1.BuildUp(IReadWriteLocator locator, Type typeToBuild, String idToBuild, Object existing, PolicyList[] transientPolicies) +194
   Microsoft.Practices.ObjectBuilder.BuilderBase`1.BuildUp(IReadWriteLocator locator, String idToBuild, Object existing, PolicyList[] transientPolicies) +111
   Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ObjectBuilder.EnterpriseLibraryFactory.BuildUp(IReadWriteLocator locator, IConfigurationSource configurationSource) +255
   Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ObjectBuilder.EnterpriseLibraryFactory.BuildUp(IConfigurationSource configurationSource) +72
   Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ObjectBuilder.NameTypeFactoryBase`1.CreateDefault() +79
   Microsoft.Practices.EnterpriseLibrary.Data.DatabaseFactory.CreateDatabase() +88
   Polyright.TPM.DataAccess.DatabaseAccess..ctor(String databaseName) in D:\Dev\TPM\TPM-Serveur\Source\Data Access Layer\Polyright.TPM.DataAccess\DatabaseAccess.cs
etc...
--------------------------------------------------------------------------------
Informations sur la version : Version Microsoft .NET Framework :2.0.50727.42; Version ASP.NET :2.0.50727.210

I followed the steps required to license the application with CoreLab. I added license.licx in my web project. Then in VS2005, I right-clicked and built the runtime licenses. A App_Licenses.dll file has been added in the bin folder.
Then when published, the license.licx has not been copied, instead the App_Licenses.dll is present in the bin folder.

What did I missed?
Thanks,
Adriano
labate
 
Posts: 48
Joined: Tue 17 Jan 2006 13:57
Location: Switzerland, Sion

Postby labate » Tue 12 Jun 2007 14:10

Looking at other posts I tried to add the following section in web.config :
Code: Select all
    <system.data>
        <DbProviderFactories>
            <add name="OraDirect .NET Data Provider" invariant="CoreLab.Oracle" description="CoreLab OraDirect .NET Data Provider" type="CoreLab.Oracle.OracleProviderFactory, CoreLab.Oracle, Version=3.55.20.0, Culture=neutral, PublicKeyToken=09af7300eec23701" />
        </DbProviderFactories>
    </system.data>


And it works now on the IIS server where I deployed the app.

Now if I add the same section to the web.config file in my project on my development machine, I cannot run anymore. It complains that :
An error occurred creating the configuration section handler for system.data: Column 'InvariantName' is constrained to be unique. Value 'CoreLab.Oracle' is already present.


I don't know if I'm right, but I think that on my development machine, this db provider factory already exists in machine.config.
In my production IIS server, this setting is not present in machine.config, and adding it to web.config is making the application working.

Now I would like to know what to do in the case I don't have access to the machine.config file on the customer server?

Is it mandatory in this case to have two different web.config files, one without the DbProviderFactories section in my dev machine, and another one on my production machine with that section?

Thanks,
Adriano
labate
 
Posts: 48
Joined: Tue 17 Jan 2006 13:57
Location: Switzerland, Sion

Postby Alexey » Wed 13 Jun 2007 05:27

To overcome this problem you need to add the following string to your web.config as well:
Code: Select all
<remove invariant="CoreLab.Oracle">
Alexey
 
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

Postby labate » Wed 13 Jun 2007 07:02

Thanks, it works well now!
labate
 
Posts: 48
Joined: Tue 17 Jan 2006 13:57
Location: Switzerland, Sion

Postby Alexey » Wed 13 Jun 2007 08:49

You are welcome.
Alexey
 
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

Re: Unable to find Data Provider error message

Postby sousou » Thu 10 Oct 2013 10:44

I can't see the code sources !!!! I don't know why!?? plz help, I have the same problem as labate, and I really need to check this solution!!!! :cry:
sousou
 
Posts: 1
Joined: Thu 10 Oct 2013 10:39

Re: Unable to find Data Provider error message

Postby Shalex » Thu 10 Oct 2013 11:03

Starting from the 5.0 release of dotConnect for Oracle there were some important name changes in the product. Particularly, assemblies, namespaces, invariant name, and some types were changed. Now the provider registration in the DbProviderFactories section of the *.config file looks like:
Code: Select all
<system.data>
  <DbProviderFactories>
    <remove invariant="Devart.Data.Oracle" />
    <add name="dotConnect for Oracle" invariant="Devart.Data.Oracle" description="Devart dotConnect for Oracle" type="Devart.Data.Oracle.OracleProviderFactory, Devart.Data.Oracle, Version=7.9.333.0, Culture=neutral, PublicKeyToken=09af7300eec23701" />
  </DbProviderFactories>
</system.data>

Replace 7.9.333.0 here with your actual version.
Shalex
Devart Team
 
Posts: 7530
Joined: Thu 14 Aug 2008 12:44


Return to dotConnect for Oracle