Upgradation of microsoft enterprise library 2.0 to 6.0

Topics: Data Access Application Block, Enterprise Library Core, Exception Handling Application Block, General discussion, Logging Application Block
Sep 4, 2014 at 5:17 AM
We are moving our project from .net 2.0 to 4.5.Along with this our client wants to upgrade our existing ms enterprise library from 2.0 to 6.0.
Currently we are using follwing features in our project:
Data Access block
Exception handling block
Logging block
So now I just want to know that is it possible to upgrade from 2.0 to 6.0?
If yes,I want to know the scope of the impact/changes.
If No, then what will be the other way to upgrade.
Thanks in advance.
Sep 4, 2014 at 5:50 AM
Edited Sep 4, 2014 at 5:51 AM
My initial answer is: probably.

There is no direct upgrade path from 2.0 to 6.0 however most of the static facades have been maintained throughout the releases. The main determinant in how easy it is to upgrade is how Enterprise Library is being used; the more "vanilla" the usage the more likely to have an easy migration but some features have been removed so it depends on the specific features being used as well.

The best way to see the impact/issues is to review the relevant Migration Guides and try to do the upgrade. As I mentioned, there is no direct upgrade path but thse resources will help :

Probably the main change will be bootstrapping the XML configuration that was introduced in version 6.

The optimistic approach would be to change the references, update the XML configuration with the correct assembly information, bootstrap the blocks and test (if compilation succeeds).

Randy Levy
Enterprise Library support engineer
Support How-to
Sep 4, 2014 at 6:23 AM
Hi Randy,
Thanks for the reply.
In one of the document what i found is,
"Yet, even in version 6, the vast majority of the code is entirely backwards compatible with applications written to use Enterprise Library 2.0."
But not able to find any of the document related to it..
So can you please guide me from where I can get that to start with upgradation from 2.0 to 6.0.

Sep 4, 2014 at 6:48 AM
You could go through the Migration Guides and analyze the code to see if there are any breaking changes (which might take a while for a large application you are not familiar with) or you could just try to upgrade.

Remove the Enterprise Library 2 references and add references to the version 6 components. If everything is good you should be able to compile. If not, you will have to determine what the issue is and if there is a workaround (e.g. change the namespace). If compilation is good then you continue by updating all XML configuration with the new assembly information (version, PublicKeyToken). You will also have to add code at application startup to bootstrap the blocks by loading the XML configuration. Usually the static facade will have a Setxxx method (e.g. Logger.SetLogWriter) to set the applicable instance.

The latest Migration Guide discusses this so definitely take a look (it's not too long).

Randy Levy
Enterprise Library support engineer
Support How-to