Upgrading EntLib 4.1 to 5 with Oracle.DataAccess.Client

Posted by mlk on Stack Overflow See other posts from Stack Overflow or by mlk
Published on 2010-04-30T12:18:21Z Indexed on 2010/05/28 16:02 UTC
Read the original article Hit count: 962

Filed under:
|
|

Hello, I am upgrading a project from EntLib 4.1 to EntLib 5. I've skimmed through the Migration Guide, changed all the references and updated all the config files to point to EntLib 5. All worked fine accept Oracle database access. With the config file:

<configuration>
  <configSections>
    <section name="dataConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSettings, Microsoft.Practices.EnterpriseLibrary.Data, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="true" />
  </configSections>
  <dataConfiguration defaultDatabase="prod">
    <providerMappings>
      <add databaseType="Microsoft.Practices.EnterpriseLibrary.Data.Oracle.OracleDatabase, Microsoft.Practices.EnterpriseLibrary.Data"
        name="Oracle.DataAccess.Client" />
    </providerMappings>
  </dataConfiguration>
  <connectionStrings>
    <add name="prod" connectionString="Data Source=dev;User Id=dev;Password=dev;"
      providerName="Oracle.DataAccess.Client" />
  </connectionStrings>
</configuration>

which worked with 4.1 all calls to DatabaseFactory.CreateDatabase() fails with:

System.InvalidOperationException: The type Database cannot be constructed. You must configure the container to supply this value.

If I replace Oracle.DataAccess.Client with the Microsoft System.Data.Oracleclient it all works again, but is not full of ODP.net lovelyness. Does anyone know how to get this to work with EntLib 5?

Cheers, Mlk

© Stack Overflow or respective owner

Related posts about .NET

Related posts about odp.net