ODP.NET for 4.0 Type Resolution

Topics: Data Access Application Block
Jan 27, 2012 at 12:17 PM
Edited Jan 27, 2012 at 12:45 PM

ODP.NET for 4.0 framework is working properly in my development machine (32-Bit).  Installation path of "Oracle.DataAccess.dll" is at "C:\Oracle\product\11.2.0\client_2\odp.net\bin\4\".

In the Server (64-Bit) we have it installed at "D:\OracleHome\product\11.2.0\client_1\odp.net\bin\4".

We have the dll included as part of the deployment directory and its available at the same location as the executable. Same code is running properly in my local machine. However, in the Server (Win 2008) its giving below error.

Activation error occured while trying to get instance of type Database, key "ConnectionString"Inner Exception Message: Resolution of the dependency failed, type = "Microsoft.Practices.EnterpriseLibrary.Data.Database", name = "ConnectionString".

Exception occurred while: while resolving.

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


At the time of the exception, the container was:

Resolving Microsoft.Practices.EnterpriseLibrary.Data.Database,ConnectionString

Could you please suggest in obtaining the root cause.

Thank you.

Jan 29, 2012 at 1:28 AM

The message you are seeing usually occurs when the configuration is not setup properly or the configuration is not being read.  Based on the message, it looks you are using a connection string called "ConnectionString".  Is that setup in the configuration file?  Can you post your configuration?

Randy Levy
Enterprise Library support engineer

Jan 30, 2012 at 3:22 AM

<dataConfiguration defaultDatabase="ConnectionString">
      <add databaseType="Microsoft.Practices.EnterpriseLibrary.Data.ODPOracle.ODPOracleDatabase, Microsoft.Practices.EnterpriseLibrary.Data, Version=5.0.414.0, Culture=neutral, PublicKeyToken=null"
          name="Oracle.DataAccess.Client" />
    <add name="ConnectionString" connectionString="UBuuQdV8aNusJpwSTE6LuEE74npdwGMB83rTzYgjBifsYVkX5slCyiXUX98nBZ1xQOLyOSG17Ymtim5Uww9jVEpS9sbHRMZLM4wihemCAhPbu6LQ9Nkm/VtbzPhs3tM7deAHveOxO0WzkxmN1a5aXgLzzHHczhJ4ZRW/ObPrPsc="
        providerName="Oracle.DataAccess.Client" />

This was working fine locally. Somehow when deployed onto Server its not working. Do we need Enterprise Library Installation in DEV server also.?

Local machine is 32-Bit and I installed as (x86 Build) in 64-Bit server. Does this has any thing to with this issue.

Jan 30, 2012 at 10:58 AM


what is it Microsoft.Practices.EnterpriseLibrary.Data.ODPOracle.ODPOracleDatabase ? where source code ?

For ODP.NET and EntLib: