Resolves a file or assembly that failed to load "Newtonsoft.json ..." or one of its dependencies. The found assembly manifest definition does not match the assembly reference. (Exception from hresult:0x80131040)

Source: Internet
Author: User

Today, I met a problem with the pit, and I thought about it for a long time ...

Because of the need to reference a third-party class library, the three-way class library refers to the Newtonsoft.Json.dll version 7.0.0 and my project references the Newtonsoft.Json.dll version 4.5.0, so that two references cause a conflict. All references are OK, the compile-time prompt "Newtonsoft.Json.Linq" is not referenced, but this is clearly quoted. Try to use NuGet Update, update to the latest version of 9.0.0, after the success of the update can be compiled successfully, but this kind of problem occurs when accessing.

The Final Solution, modify Web. config, here is just to tell you the format, just add the full dependentassembly content.

<Runtime>    <assemblybindingxmlns= "Urn:schemas-microsoft-com:asm.v1">      <dependentassembly>        <assemblyidentityname= "Webgrease"PublicKeyToken= "31bf3856ad364e35"Culture= "neutral" />        <BindingRedirectoldversion= "0.0.0.0-1.5.2.14234"newversion= "1.5.2.14234" />      </dependentassembly>      <dependentassembly>        <assemblyidentityname= "Newtonsoft.json"PublicKeyToken= "30ad4fe6b2a6aeed"Culture= "neutral" />        <BindingRedirectoldversion= "0.0.0.0-7.0.0.0"newversion= "7.0.0.0" />      </dependentassembly>    </assemblybinding>  </Runtime>

Resolves a file or assembly that failed to load "Newtonsoft.json ..." or one of its dependencies. The found assembly manifest definition does not match the assembly reference. (Exception from hresult:0x80131040)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.