Could not load file or assembly 'System.ValueTuple'

项目目标框架:.Net Framework 4.6.2
报错:Could not load file or assembly 'System.ValueTuple'
在4.6.2项目中,想要使用C#7.0新特性ValueTuple,需要添加nuget引用System.ValueTuple。
项目一开始引用的是最早的版本4.3.0的System.ValueTuple,使用正常。
前几天更新成了当前最新稳定版4.5.0,发布项目,返回报错信息:Could not load file or assembly 'System.ValueTuple, Version=4.0.3.0, Culture=neutral

在Stack Overflow找到同类问题,Could not load file or assembly 'System.ValueTuple'

Stack Overflow给出的解决方案有多种:
第一种:System.ValueTuple nuget降级回4.3.0
第二种:修改配置文件,指定版本

我尝试了第一种方案,未能解决。
尝试第二种解决方案,项目运行完好,报错解决。

 <dependentAssembly>
        <assemblyIdentity name="System.ValueTuple" culture="neutral" publicKeyToken="cc7b13ffcd2ddd51" />
        <bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" />
      </dependentAssembly>
全部评论

相关推荐

不愿透露姓名的神秘牛友
06-27 15:07
点赞 评论 收藏
分享
喜欢飞来飞去的雪碧在刷代码:可以试一试字节
点赞 评论 收藏
分享
05-07 19:10
已编辑
中国科学技术大学 C++
silly01:现在先去 momenta,8-9月去鹅找日常实习,八股文算法背好了你这随便进。不过建议补充一下后端知识,MySQL、Redis看下八股,再补个6824,加点go后台的技术栈,9月随便进大厂。CPP后端只能来WXG
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务