Could not load file or assembly 'Microsoft.Practices.EnterpriseLibrary.Common' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference RRS feed

  • Question

  • User81553806 posted
    I have webapi application referencing Microsoft.Practices.EnterpriseLibrary.Common. web.config file is showing the correct version 5.505.0 and project also referring the same. But while running the application I am getting error like it is not able to load the microsoft.practices.enterpriselibrary.common version though this version is not there in web.config file.
    What could be the reason to show this error? Help me in resolving this issue.
    Thursday, October 4, 2018 7:54 PM

All replies

  • User1724605321 posted

    Hi gkrishnat ,

    The problem is that the DLL that you are using and the one that is referenced in your project are different. 

    You can 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.

    Reference : https://stackoverflow.com/questions/8431220/could-not-load-file-or-assembly-microsoft-practices-enterpriselibrary-common-o

    Please also check other replies in that thread for potential solution .

    Best Regards,

    Nan Yu

    Friday, October 5, 2018 2:00 AM