Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask question.(5)

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

ITtutoria

ITtutoria Logo ITtutoria Logo

ITtutoria Navigation

  • Python
  • Java
  • Reactjs
  • JavaScript
  • R
  • PySpark
  • MYSQL
  • Pandas
  • QA
  • C++
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Python
  • Science
  • Java
  • JavaScript
  • Reactjs
  • Nodejs
  • Tools
  • QA
Home/ Questions/What is the the located assembly's manifest definition does not match the assembly reference problem, and how to solve it?
Next
Answered
Kyra Wang
  • 28
Kyra Wang
Asked: May 17, 20222022-05-17T14:16:40+00:00 2022-05-17T14:16:40+00:00In: csharp

What is the the located assembly’s manifest definition does not match the assembly reference problem, and how to solve it?

  • 28

. Advertisement .

..3..

. Advertisement .

..4..

I get an error

System.IO.FileLoadException: Could not load file or assembly 'Utility, Version=1.2.0.200, Culture=neutral, PublicKeyToken=764d581291d764f7' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)**

at x.Foo.FooGO()

at x.Foo.Foo2(String groupName_) in Foo.cs:line 123

at x.Foo.UnitTests.FooTests.TestFoo() in FooTests.cs:line 98**

System.IO.FileLoadException: Could not load file or assembly 'Utility, Version=1.2.0.203, Culture=neutral, PublicKeyToken=764d581291d764f7' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

when trying to run some unit tests in a C# Windows Forms application (VS 2005). How to fix the the located assembly’s manifest definition does not match the assembly reference error? Please give me some advice.

could not load file
  • 2 2 Answers
  • 146 Views
  • 0 Followers
  • 0
Answer
Share
  • Facebook
  • Report

2 Answers

  • Voted
  • Oldest
  • Recent
  • Random
  1. Best Answer
    dttutoria Expert
    2022-06-07T09:56:55+00:00Added an answer on June 7, 2022 at 9:56 am

    The cause: As this assembly doesn’t quite match what was requested, you will receive this error. Because the.NET Assembly loader cannot find 1.2.0.203 while it finds a 1.2.0.200.
    You can simply understand that it can’t find the assembly that was mentioned. Put it in the GAC or the application path to ensure it can find the proper assembly.

    Solution:

    Any assembly version will be redirected to the version 3.1.0.0 using the code below. We have a script that will always renew this reference in the App.config, ensuring that we never need to deal with this problem again.

    You may obtain the assembly publicKeyToken and generate this block from the.dll file itself by using reflection.

    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
    <dependentAssembly>
    <assemblyIdentity name="Castle.Core" publicKeyToken="407dd0808d44fbdc" culture="neutral" />
    <bindingRedirect oldVersion="0.0.0.0-65535.65535.65535.65535" newVersion="3.1.0.0" />
    </dependentAssembly>
    </assemblyBinding>
    • 20
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report
  2. Emma Buisson
    2022-05-26T03:56:07+00:00Added an answer on May 26, 2022 at 3:56 am

    To resolve this problem, there are a few things you can do. To search your hard disk for the assembly (.dll), use Windows file search. After you have a list, click View->Choose details and then select “File Version”. This will show you the version number in your list of results.

    Lars also suggested that you check your GAC to determine which version is there. The Microsoft article states assemblies in the GAC cannot be copied locally during a build. You might have to remove the older version before you do a complete rebuild. 

    To find out more about binding failures, use fuslogvw.exe that comes with Visual Studio. Microsoft provides information on this tool. You will need to enable logging by changing the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Fusion\EnableLog registry key.

    • 10
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

Sidebar

Ask A Question
  • How to Split String by space in C++
  • How To Convert A Pandas DataFrame Column To A List
  • How to Replace Multiple Characters in A String in Python?
  • How To Remove Special Characters From String Python

Explore

  • Home
  • Tutorial

Footer

ITtutoria

ITtutoria

This website is user friendly and will facilitate transferring knowledge. It would be useful for a self-initiated learning process.

@ ITTutoria Co Ltd.

Tutorial

  • Home
  • Python
  • Science
  • Java
  • JavaScript
  • Reactjs
  • Nodejs
  • Tools
  • QA

Legal Stuff

  • About Us
  • Terms of Use
  • Privacy Policy
  • Contact Us

DMCA.com Protection Status

Help

  • Knowledge Base
  • Support

Follow

© 2022 Ittutoria. All Rights Reserved.

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.