UnityContainer - Having issues Resolving OdpNet.OracleDatabase

Topics: Data Access Application Block
Nov 17, 2011 at 12:16 AM

Hello All fellow code junkies, 

I have downloaded Enterprise Library Contrib - 5.0 (Oct 2011) and installed per instructions 

 

My web.config has:

<dataConfiguration defaultDatabase="MyOracleDB">   

<providerMappings>     

<add databaseType="Microsoft.Practices.EnterpriseLibrary.Data.Oracle.OracleDatabase, Microsoft.Practices.EnterpriseLibrary.Data" name="Oracle.DataAccess.Client" />   

</providerMappings> 

</dataConfiguration>

 

<connectionStrings>   

<add name="Connection String" connectionString="Database=Database;Server=(local)\SQLEXPRESS;Integrated Security=SSPI"      providerName="System.Data.SqlClient" />   

<add name="MyOracleDB" connectionString="data source=MINE;user id=XXXXX;password=XXXXX;"  providerName="Oracle.DataAccess.Client" />

</connectionStrings>

 

********************** START - HERE IS THE ISSUE I'M HAVING ***********************************

My code specifies a concrete DB (not a generic one)

  Dim Ucontainer = New UnityContainer()       

  Ucontainer.AddNewExtension(Of EnterpriseLibraryCoreExtension)()

  _DB = Ucontainer.Resolve(Of OdpNet.OracleDatabase)("MyOracleDB")

Note:

OdpNet.OracleDatabase is from EntLiContrib.Data.OdpNet

And I keep getting the followin error message

Resolution of the dependency failed, type = "EntLibContrib.Data.OdpNet.OracleDatabase", name = "OraAspNetProvider". Exception occurred while: while resolving. Exception is: InvalidOperationException - The type String cannot be constructed. You must configure the container to supply this value. 

********************** END - HERE IS THE ISSUE I'M HAVING ***********************************

 

NOTES:

-- It works OK when I execute the following to build a generic one (using the Unity service locator)

_DB = EnterpriseLibraryContainer.Current.GetInstance(Of Database)()

-- It work OK when I specify a concrete DB of MS SQL

_DB = Ucontainer.Resolve(Of SqlDatabase)("Connection String")

-- I have ODP.NET Version=2.111.7.20

 

Thank you folks - edo@rdo -

Nov 20, 2011 at 2:20 AM

Hi,

I think your question would be a better fit at the entlibcontrib forum.

--
Randy Levy
Enterprise Library support engineer
entlib.support@live.com

Nov 20, 2011 at 5:51 AM

Chucks.. . I though I had put this on the Entlibcontrib forum....   my bad

anyways, I did find a way to resolve this

Best Regards. 

E.Vazquez