Migration 1.1 to 5.0 comprehensive change log

Topics: General discussion
Sep 12, 2012 at 12:20 AM
Edited Sep 12, 2012 at 12:21 AM

Existing code base using Enterprise Library June 2005 (1.1) would like to migrate to Enterprise Library 5.0.  I have downloaded "Microsoft Enterprise Library 5.0 Migration Guide" but "Suggested Steps for Migration" section only refer to 3.1 as the earliest version.  What would be the recommended process, steps involved, version change logs, documentation?  Please advise whether it is likely to be alot of breaking changes.  Thank you.

Sep 12, 2012 at 3:08 AM

There have been many changes over the last 7 years.  Probably the biggest changes are from version 1 to version 2.  You can read the various migration documents:

Version 1 to 2 migration: http://msdn.microsoft.com/en-us/library/ff648527.aspx.  Biggest change is that configuration application block is removed.

Changes to version 3: http://msdn.microsoft.com/en-us/library/cc309061.aspx.

The Migration Guide covers moving From version 3.1 to 5.

Whether there are a lot of breaking changes depends on what blocks you are using and how you are using them.  In general the static facade methods have been fairly unchanged over the years but the configuration has changed quite a bit.

Randy Levy
Enterprise Library support engineer

Sep 13, 2012 at 7:58 PM

Thank you for your previous reply.  In one project, the only application block we seem to be using is 'Microsoft.Practices.EnterpriseLibrary.Data'.  It is connecting to Oracle DB, using Database, DatabaseFactory, DBCommandWrapper classes.  I downloaded the EntLib50 and replaced the reference(s) to the V5 of 'Microsoft.Practices.EnterpriseLibrary.Data' and 'Microsoft.Practices.EnterpriseLibrary.Common' DLLs.  However, I can not find 'Microsoft.Practices.EnterpriseLibrary.Configuration'  DLL, I get the following error (see below).  Please advise.  Thank you

Error 89 The type 'Microsoft.Practices.EnterpriseLibrary.Configuration.ConfigurationProvider' is defined in an assembly that is not referenced. You must add a reference to assembly 'Microsoft.Practices.EnterpriseLibrary.Configuration, Version=, Culture=neutral, PublicKeyToken=null'.

Sep 13, 2012 at 8:14 PM

Configuration Application block was removed in version 2.0.  I would recommend creating an equivalent configuration using the Enterprise Library 5 configuration tool.

If you are using ODP.NET then you will want to use a different provider than the default. See http://devstuffs.wordpress.com/2012/03/13/enterprise-library-5-with-odp-net/ for a walkthrough.

Randy Levy
Enterprise Library support engineer

Sep 24, 2012 at 11:37 PM

Thank you for your early replies, it has been very helpful.  Previously, the soln was using a Enterprise Library Configuration V1.1 tool to create an encrypted dataConfiguration.config.  I can use the navigation tree control on the left to look at the dataConfiguration - XML File Storage Provider & XML Serializer Transformer, Connection Strings, Database Instances, Database Types.  In VS2010, I right click on my web.config in my soln (which has the <enterpriselibrary.configurationSettings> specifying encrption and the original dataConfiguration.config created originally with V1.1), select 'Edit Enterprise Library V5 Configuration'.  The V5 IDE is layed out differently, under the top menu items 'File' "Blocks' Wizards' 'Environment' is 'Application Settings' and 'Database Settings'.

Q. Can you confirm my assumption that dataConfiguration.config needs to be regenerated using V5 because many of the settings are specifying the old Microsoft.Practices.EnterpriseLibrary.Data Version=

Yes, we are using ODP.NET.  I read the link you kindly provided.  We are using older Oracle9i Release 2 and Oracle Data Access Components (ODAC)

My task seems to be to manually export the key/values (i.e cut & paste)  from Enterprise Library Configuration V1.1 tool and plug them into the V5 to regenerate a dataConfiguration.config which is correct for Enterprise Library V5 and my version of ODAC.  Any additional advise would be appreciated.  Thank you..

Sep 25, 2012 at 1:21 AM

I'm not an expert on ODP but you should just have to configure the connection string (along with the provider information) as per the EntlibContrib site:

<?xml version="1.0" encoding="utf-8"?>
		<section name="dataConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSettings, Microsoft.Practices.EnterpriseLibrary.Data, Version=5.0.505.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
		<section name="oracleConnectionSettings" type="EntLibContrib.Data.OdpNet.Configuration.OracleConnectionSettings, EntLibContrib.Data.OdpNet" />
	<dataConfiguration defaultDatabase="Service_Dflt">
			<add databaseType="EntLibContrib.Data.OdpNet.OracleDatabase, EntLibContrib.Data.OdpNet, Version=5.0.505.0, Culture=neutral, PublicKeyToken=null" name="Oracle.DataAccess.Client" />
		<add name="OracleTest">
				<add name="PKGNORTHWIND" prefix="NWND_" />
				<add name="PKGENTLIB" prefix="RegionSelect" />
		<add	name="Service_Dflt"
			connectionString="Data Source=XE;User id=Northwind;Password=Northwind;" />
		<add	name="NewDatabase"
			connectionString="Data Source=XE;User id=Northwind;Password=Northwind;" />
		<add	name="DbWithOracleAuthn"
			connectionString="Data Source=XE;User id=Northwind;Password=Northwind"/>
		<add	name="NwindPersistFalse"
			connectionString="Data Source=XE;User id=Northwind;Password=Northwind;Persist Security Info=false"/>

Randy Levy
Enterprise Library support engineer

Sep 25, 2012 at 7:56 PM

Thankyou for your previous reply.  I am trying the 'clear text' example you provided, modifying it to our Oracle databases and merging it into our existing web.config. I have commented out the <oracleConnectionSettings> block because I couldn't confirm it was required.  I get the following exception when I run.  I have replaced the actual file path in the exception message with periods (...).

  Invalid section name. The section 'dataConfiguration' does not exist in the requested configuration file 'C:\....\.....\....\...\....\web.config' or the file 'c:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Config\machine.config'. Make sure that the 'enterpriseLibrary.configurationSections' configuration section exists in one of the files and that the section 'dataConfiguration' is defined.

Orginally, in the web.config it contained (see below) the following which wrapped all encryted dataConfiguration.config configuration information.  Since we are using the 'clear text' example you provided I have commented it out in the web.config.  However, the exception indicates the 'enterpriseLibrary.ConfigurationSections' configuration still needs to exist!  Please advise what might be the cause of the exception.  Thank you

<enterpriselibrary.configurationSettings applicationName="Application" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.microsoft.com/practices/enterpriselibrary/08-31-2004/configuration">



Sep 26, 2012 at 3:43 AM

The fastest way to see what is happening is probably to create a sample project to reproduce the problem along with all dependent assemblies that you are using.

Randy Levy
Enterprise Library support engineer

Sep 26, 2012 at 9:39 PM

Thank you for your previous reply.  The sample I choose was the 'EntLib50racle' sample console application from:  



I simply changed one line in the App.config connectionString parameter(s) in "DefaultConnectionString" to use a Data Source defined in 'tnsnames.ora' because our real database is on the network.  I get an 'ActivationException was unhandled' exception, 'Activation error occured while trying to get instance of type Database, key"" in UserData.cs, UserData(),  line 17, database = EnterpriseLibraryContainer.Current.GetInstance<Database>();

Please advise how we can get this simple example working by connecting to our real network database.  Thank you.

FYI. I did download the sample scripts used to set up on a database, but I haven't bothered because I want to get this statement working.

Sep 26, 2012 at 11:27 PM

See if adding the OracleClientFactory helps as per http://entlib.codeplex.com/discussions/394482.

Randy Levy
Enterprise Library support engineer

Sep 27, 2012 at 12:41 AM

I added the following to my App.config as per http://entlib.codeplex.com/discussions/394482

    <add name="Oracle Data Provider for .NET" invariant="Oracle.DataAccess.Client"
description="Oracle Data Provider for .NET" type="Oracle.DataAccess.Client.OracleClientFactory, Oracle.DataAccess, Version=, Culture=neutral, PublicKeyToken=89b483f429c47342" />

I replaced UserData.cs, UserData() line 17 with:

OracleClientFactory factory = new OracleClientFactory().  Which threw a 'TypeInitializationException' - "The type initializer for 'Oracle.DataAccess.Client.OracleClientFactory' threw an exception".  Inner Exception - "The provider is not compatible with the version of Oracle client'.

I have a general comment regarding strongly named assemblies (i.e version number and public key) when defined in above <DbProviderFactories> web.config entry.  Q. Am I expected to update this (version number i.e Version=, public key i.e. PublicKeyToken=89b483f429c47342" ) information based on the DLLs in this sample soln or GAC?

Please advise... Thank you

Sep 27, 2012 at 12:51 AM

The version number should definitely correspond to the version number you have installed.  If you are still have issues, I would recommend moving this discussion over to Enterprise Library Contrib discussion group.

Randy Levy
Enterprise Library support engineer

Jan 16, 2014 at 10:55 AM
Any updates for Enterprise Library 6.0 and ODP.NET ?

Maybe using the ODP.NET Managed Driver (if you are using .Net 4): https://www.nuget.org/packages/odp.net.managed/

Oracle ODP.net Managed vs Unmanaged Driver. Avoid all the "unmanaged" what DLL what architecture issues!

Managed ODP.NET Support (Oracle.ManagedDataAccess)