I am using the trial version of dotConnect for Oracle to see if it is a suitable replacement for the .Net framework intrinsic Oracle client in our applications, as we want to remove the dependency on the Oracle Client on client workstations. I have installed dotConnect and looked at the Data Access Quick Start sample to see how it all hung together. I knocked up a small test app using VS2010 targeting Framework 3.5 (as we do with our apps) and having added the appropriate bits to the app.config for provider mapping etc it all worked beautifully (I should add we use Enterprise Library 5 for managing database objects etc). I then added a simple setup and deployment project to build a simple installer and ran it, again on my development machine, and all worked as expected.
However, I have all sorts of stuff installed on my dev machine including the Oracle client so in order to test that it would truly work as we wanted it I installed the test app onto a VM with a vanilla install of Win 7 x86. The installer seemed to put in everything the app requires and the app itself starts. However when I click the 'Test' button (which should simple execute a simple statement and display the results), I get an Enterprise Library exception whcih is one of the less helpful ones that EL can throw:
I have had that error before with EL but all the usual suspects don't seem to apply here as I know for certain that the environment name in the config is the one being requested and so on, plus as I say this works perfectly on my development machine.Microsoft.Practices.ServiceLocation.ActivationException: Activation error occured while trying to get instance of type Database, key "Testing26_devart" ---> Microsoft.Practices.Unity.ResolutionFailedException: Resolution of the dependency failed, type = "Microsoft.Practices.EnterpriseLibrary.Data.Database", name = "Testing26_devart".
I should point out a few things about how we utilise EL. We do not use the provider factory classes, instead we use the EL5 recommended way of obtaining a database instance:
Code: Select all
Dim db As Database = EnterpriseLibraryContainer.Current.GetInstance(Of Database)(EnvironmentName)
Code: Select all
<add name="Testing26_devart" connectionString="User Id=Testing26;Password=Testing26;Server=Oracle-Server;Direct=True;Sid=DEVORA;Port=1523;" providerName="Devart.Data.Oracle"/>
Code: Select all
<dataConfiguration>
<providerMappings>
<add databaseType="Devart.Data.Oracle.EnterpriseLibrary.OracleDatabase, Devart.Data.Oracle.EnterpriseLibrary" name="Devart.Data.Oracle" />
</providerMappings>
</dataConfiguration>
- Devart.Data
Devart.Data.Oracle
Devart.Data.Oracle.EnterpriseLibrary
Microsoft.Practices.EnterpriseLibrary.Common
Microsoft.Practices.EnterpriseLibrary.Data
Microsoft.Practices.ServiceLocation
Microsoft.Practices.Unity.Configuration
I checked then license wizard and clicked on the Fix button to ensure the license.licx file was included in the test app project (although it doesn't appear in the built output as far as I can see - should it?).
Can anyone suggest what I might be doing wrong? I can provide any more information that is required. I really want to get this working as I am keen to get our applications away from using the Oracle Client, as is my boss (they must be as they've agreed to stump up for the full version so long as the proof-of-concept works!).
Many thanks
Steve Pettifer