Could not load file or assembly 'Newtonsoft.Json, Version=3.5.0.0,

本文详细介绍了.NET项目中如何正确配置Newtonsoft.Json与ExtAspNet之间的依赖关系,确保程序集放置在项目根目录下,并根据不同.NET版本引用对应的Newtonsoft.Json.dll版本。同时提供了解决常见加载错误的指导。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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

http://stackoverflow.com/questions/3374279/help-me-for-json-unknown-problem

That assembly either needs to be placed in your applications root directory or in your GAC.

ExtAspNet依赖于Newtonsoft.Json.dll
ExtAspNet.dll只有一个For Net2.0的版本,无论你的项目是2.0、3.5、4.0,都只需要引用同一个ExtAspNet.dll即可。
而Newtonsoft.Json.dll为在每个DotNet下都有自己的版本,比如你的项目是基于.Net 2.0的,就要引用json.net\Net20\Newtonsoft.Json.dll,如果你的项目是基于.Net 4.0的,就要引用json.net\Net40\Newtonsoft.Json.dl

程序集需要放到项目根目录下面 如图:

转载于:https://www.cnblogs.com/xust/articles/2724199.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值