There is a requirement of migrating our ASP.Net application(3.5 framework) to .Net framework 4.6.2. EnterpriseLibrary v5 was used and we are migrating/replacing to EL v6 using Nuget manager in the migrated ASP.Net project(4.6.2 framework).
I am facing issue in EL v6 dll during run time. Tough, I have added all the required dll's from Nuget manager, I get error message saying the dll is not available.
Error :
Could not load type 'Microsoft.Practices.EnterpriseLibrary.Common.Configuration.EnterpriseLibraryContainer' from assembly 'Microsoft.Practices.EnterpriseLibrary.Common, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
Here are the versions of EL I have loaded in my solution -
- Microsoft.Practices.EnterpriseLibrary.Common : v6.0.1304
- Microsoft.Practices.EnterpriseLibrary.Data : v6.0.1304
- Microsoft.Practices.EnterpriseLibrary.ExceptionHandling : v6.0.1304
- Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging : v6.0.1304
- Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.WCF : v6.0.1304
- Microsoft.Practices.ServiceLocation : : v1.0.0
- Microsoft.Practices.Unity.Configuration : v4.0.1
- Microsoft.Practices.Unity : v4.0.1
- Microsoft.Practices.Unity.Interception.Configuration : v4.0.1
- Microsoft.Practices.Unity.Interception : v4.0.1
Please advise, how can I resolve all these issues..
The actual issue here was, the EnterpriseLibrary version for caching was 5.0505 and for the rest was 6.0.1304 - which are latest in the Nuget manager. Due to this discrepancy in the dll versions, "Microsoft.Practices.EnterpriseLibrary.Caching" was giving issue. Also, the latest release of Enterprise Library(6.0.1304) retired the following application blocks:
and hence, instead of using Microsoft.Practices.EnterpriseLibrary.Caching while migrating, we are supposed to use "System.Runtime.Caching".
Reference - https://msdn.microsoft.com/en-us/library/dn169621.aspx
This solved my issue finally!.