The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

Anshul Mittal 201 Reputation points
2021-05-28T07:33:29.313+00:00

I have a WCF service which is referencing a COM dll. I keep getting the error as follows.

Could not load file or assembly 'Interop.ABBCLIENTLICENSEPROVIDERLib, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

To test if it is assembly related problem or reference related problem, i created a console application and used this reference ABBCLIENTLICENSEPROVIDERLib and it worked fine. There is no error in console application.

Only the WCF application is throwing the exception.

This is high priority task and immediate help is appreciated.

Developer technologies | .NET | Other
Developer technologies | C#
0 comments No comments
{count} votes

Accepted answer
  1. Anshul Mittal 201 Reputation points
    2021-05-31T12:10:06.363+00:00

    Remove references to existing COM libraries and then readd the references with "Embed Interop Types = True".

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. AddWebSolution 171 Reputation points
    2021-05-28T10:42:52.967+00:00

    Try this first :-
    right click on reference -> properties -> change 'Specific Version' to false.
    Also refer this :-
    the-located-assemblys-manifest-definition-does-not-match-the-assembly-reference
    https://stackoverflow.com/questions/4187907/net-picking-wrong-referenced-assembly-version

    2 people found this answer helpful.
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.