.net – How to upgrade Enterprise Library to the latest version

enterprise-librarynetvisual studio 2010

I am currently using Enterprise Library's exception logging functionality in several of my apps.

A while back, I installed Enterprise Library onto my machine so that I could launch the configuration utility from my Visual Studio toolbar. Everything was great until my latest project.

A few weeks ago I used NuGet to pull down the Enterprise Library libraries I needed into my project. The libraries it pulled were version 5.0.505.0. The Enterprise Library I have installed on my machine is 5.0.414.0. I originally configured everything in the project, and all the references in the config file were set to .414. Naturally, it wouldn't run, so I changed them all to .505 and everything ran. Now the problem is that I need to make some changes, and the editor won't run because of the version conflict.

So, I checked out MSDN and I tried to download this update, but the update won't run, stating that an older version of Enterprise Library is installed.

I've considered uninstalling and then re-installing the latest Enterprise Library, which would probably work. However, I wanted to check if anyone knows of a more integrated upgrade approach?

Is there any way to upgrade Enterprise Library without uninstalling and re-installing?

Best Answer

From the Optional Update 1 link:

When upgrading from Enterprise Library 5.0, you have two options:

  1. Uninstall Enterprise Library 5.0 and then execute a clean installation.

  2. Upgrade Enterprise Library 5.0 to Optional Update 1 from the command prompt by: (a)renaming the Enterprise Library 5.0 Optional Update 1.msi file to Enterprise Library 5.0.msi and (b) executing the following command from the command prompt:

msiexec /i "Enterprise Library 5.0.msi" REINSTALLMODE=vomus REINSTALL=ALL

If you want to "keep" version 5.0.414.0 around then backup the C:\Program Files (x86)\Microsoft Enterprise Library 5.0\Bin directory and you can always reference the 414 assemblies from the backup directory and run the config tool by setting up a configuration set. See Avoiding configuration pitfalls with incompatible copies of Enterprise Library for an old article that should still be relevant (with appropriate version changes).

Also, if you install the Microsoft.Practices.EnterpriseLibrary.ConfigConsole.vsix from the Optional Update 1 download or EnterpriseLibrary.config on NuGet it will add a context sensitive configuration tool that will allow you to set the binaries path on a per solution basis (and avoid modifying the registry as in the previous method). Provided you backed up the 414 binaries this would let you to run the configuration tool in one solution against 414 and in another solution against 505.