Cannot find EnterpriseLibraryCoreExtension in Ent Lib 6.0

May 1, 2013 at 12:19 PM

I'm using Unity and Ent Lib 5.0 Logging block in mvc project and I had registered Ent Lib classes with Unity using EnterpriseLibraryCoreExtension. Now I'm trying to upgrade to Ent Lib 6 but cannot find EnterpriseLibraryCoreExtension. Can you please help? Is there another pattern to follow?

May 1, 2013 at 8:08 PM
EnterpriseLibraryCoreExtension has been removed in the latest version. From the Migration Guide:
The Enterprise Library blocks no longer use the Unity container to resolve instances. You should
remove all calls to the AddNewExtension<EnterpriseLibraryCoreExtension> method of the
Unity container from your code. If your application currently resolves Enterprise Library objects
from the container, you must either manually register the required types in the Unity container,
or modify your application to use the static facades in the blocks to configure and retrieve the
Enterprise Library objects your application uses.
So for logging you could do something like this:
IConfigurationSource configurationSource = ConfigurationSourceFactory.Create();
LogWriterFactory logWriterFactory = new LogWriterFactory(configurationSource);

// Singleton

Randy Levy
Enterprise Library support engineer
Support How-to