question

NavnathNamde-0501 avatar image
0 Votes"
NavnathNamde-0501 asked ChaoDeng-MSFT edited

Could not load file or assembly 'Microsoft.Practices.EnterpriseLibrary.Data, Version=5.0.414.0,

We have use Microsoft.Practices.EnterpriseLibrary.Data, Version=5.0.414.0 in program. from last 10 year its working but somehow it stop working and giving an following error.

Same code is working on our production server but it giving error on UAT/Dev server .

So please help into this quickly.


error message: {"Could not load file or assembly 'Microsoft.Practices.EnterpriseLibrary.Data, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'
or one of its dependencies. The system cannot find the file specified.":"Microsoft.Practices.EnterpriseLibrary.Data, Version=5.0.414.0,
Culture=neutral, PublicKeyToken=31bf3856ad364e35"}


Regards,
Navnath Namde

dotnet-aspnet-core-mvc
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

ChaoDeng-MSFT avatar image
0 Votes"
ChaoDeng-MSFT answered ChaoDeng-MSFT edited

Hi @NavnathNamde-0501,

According to the error message you provided, the following solutions may help you.
First,you can check if the project where you imported Enterprise Library 5 DLLs relies on .NET Framework 4.
Another possibility is that if the reference does not have the "CopyLocal" flag set to true, this usually happens:

1.Open your solution
2.Expand until you find your project
3.Expand references
4.Select the mentioned assembly
5.Right-click and press properties (or press F4)
6.Where it says "Copy local" set it to true

Also, this can happen if you are missing the other enterprise library blocks needed by the mentioned assembly (and copy local true as well), which are:

■Microsoft.Practices.EnterpriseLibrary.Common.dll
■Microsoft.Practices.ServiceLocation.dll
■Microsoft.Practices.Unity.Configuration.dll
■Microsoft.Practices.Unity
■Microsoft.Practices.Unity.Interception.Configuration
■Microsoft.Practices.Unity.Interception

Another way is to delete all related DLL (Microsoft.Practices.*.dll) files from your folder bin and rebuild the solution.



If the answer is helpful, please click "Accept Answer" and upvote it.

Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

Best Regards,

ChaoDeng


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.