Could not load file or assembly 'Microsoft.Practices.EnterpriseLibrary.Common' or one of its dependencies

前端 未结 5 694
Happy的楠姐
Happy的楠姐 2020-12-17 14:26

I have searched google for this and could not find the solution to the problem.

My Website references DAL (custom dll) which references Enterprise Library Data Acces

5条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-17 14:44

    The problem is that the DLL that you are using and the one that is referenced in your project are different. I'm not sure what the difference in the manifest is, but it could be version and/or public key.

    You have a couple of things to try:

    1. Open the properties for the DLL reference in your project and set Version Specific to false.

    2. Remove the reference, delete the DLL from the bin folder, and re-add the reference.

    3. You could also have a different/incorrect version in your GAC. In order to make sure that you are always using a specific, known version create an assemblies folder relative to your project directory, copy the dll to that directory, and add a reference to the DLL in the assemblies directory rather than one in GAC or elsewhere on your machine. This will ensure that only the specific version that you have targeted for the application will be used rather than any version that is updated on your machine at a later time.

提交回复
热议问题