Could not load file or assembly 'Newtonsoft.Json' or one of its dependencies

前端 未结 10 2877
独厮守ぢ
独厮守ぢ 2021-02-20 10:31

First, It is not just duplicate. None of answers from following questions are working for me.

http://goo.gl/tS40cn
http://goo.gl/pH6v2T

I\'ve just updated al

相关标签:
10条回答
  • 2021-02-20 10:53

    Run Update-Package Newtonsoft.Json -Reinstall

    It should remove the reference to your 4.5 version, and reinstall the newer version referenced in your package.config. It will also update the binding redirect, which should then be as follows:

    <dependentAssembly>
      <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
      <bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" />
    </dependentAssembly>
    

    Since you said in your question that you already tried this, you might want to first try removing the existing reference manually. You might also want to make sure the files aren't read-only on disk, or otherwise locked by source control.

    0 讨论(0)
  • 2021-02-20 10:57

    Change the config to as mentioned below:

    0 讨论(0)
  • 2021-02-20 10:58

    I had this error myself, and first used Update-Package –reinstall Newtonsoft.Json -IncludePrerelease it didn't work, then used Install-Package Newtonsoft.Json . it worked.

    0 讨论(0)
  • 2021-02-20 10:59

    run this command in the package manager console:

    PM> Install-Package Newtonsoft.Json -Version 6.0.1
    
    0 讨论(0)
提交回复
热议问题