• 未能加载文件或程序集“Newtonsoft.Json”或它的某一个依赖项。找到的程序集清单定义与程序集引用不匹配。 (异常来自 HRESULT:0x80131040)


    报错信息:

    “/”应用程序中的服务器错误。
    未能加载文件或程序集“Newtonsoft.Json”或它的某一个依赖项。找到的程序集清单定义与程序集引用不匹配。 (异常来自 HRESULT:0x80131040)

    未改之前

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

    按照网上的方法,在引用中找到 Newtonsoft.Json 右击属性,与原配置文件 web.config 中写的配置不一致

    改后

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

    保存web.config 执行,正常情况这个时候就可以正常执行了

    而我再次出现问题,问题如下

    “/”应用程序中的服务器错误。
    找不到方法:“Void Newtonsoft.Json.Serialization.DefaultContractResolver.set_IgnoreSerializableAttribute(Boolean)”。

     出现这种情况请下载比较新的版本 

      如: 6.0 版本 Newtonsoft.Json.bll

    引用,重新修改配置文件中Newtonsoft.Json的版本号,保存执行,解决问题

    
    
  • 相关阅读:
    经典51懒人5步速成法
    C语言数组元素的查询
    C语言二维数组
    C语言数组的概念
    C语言基础之水仙花数
    说说M451例程讲解之定时器
    位运算符、按位与、按位或、按位非、左移、右移、原码、反码、补码
    语音中的关于语音识别的一些知识
    caffe的db_lmdb.hpp文件
    lmdb存储的一些库相关函数
  • 原文地址:https://www.cnblogs.com/dyd520/p/14693993.html
Copyright © 2020-2023  润新知