Search code examples
c#.netvisual-studiowcfenterprise-library

.net framework 4.7.2 and Microsoft EnterpriseLibrary v5 version incompatibility?


I have my projects currently targeting .Net Framework 4.5.2 and using Microsoft EnterpriseLibrary.Data 5.0.505.0. If I change my projects target to .Net Framework to 4.7.2 I receive the error

'System.IO.FileNotFoundException: 'Could not load file or assembly 'Microsoft.Practices.EnterpriseLibrary.Data, Version=5.0.505.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.'

The Microsoft.Practices.EnterpriseLibrary.Data is referenced by the project and of the same version listed in the error, and if I change the target framework back to 4.5.2 I do not have this issue. Is there a compatibility issue between .net 4.5.2 and EnterpriseLibrary v5?


Solution

  • I was able to fix this issue by copying the Microsoft.Practices.EnterpriseLibrary.Data file to my projects executable folder which in my case was /bin/Debug/ .

    Despite my reference having 'Copy Local' set to true the file was not copied. It's still unclear to me why the issue did not occur when changing the target framework to .Net 4.5.2.