Could not load file or assembly 'System.ValueTuple'
程序员文章站
2024-03-30 23:58:21
项目目标框架:.Net Framework 4.6.2 报错:Could not load file or assembly 'System.ValueTuple' 在4.6.2项目中,想要使用C 7.0新特性ValueTuple,需要添加nuget引用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找到同类问题,
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>
推荐阅读
-
Could not load file or assembly 'System.ValueTuple'
-
Could not load assembly 'xxx'. Ensure it is referenced by the startup project 'xxx'
-
Could not load assembly 'xxx'. Ensure it is referenced by the startup project 'xxx'
-
Could not load file or assembly "App_Licenses.dll"的问题
-
Could not load file or assembly ‘NQuantLib‘ or one of its dependencies. An attempt was made to load
-
完美解决Could not load file or assembly AjaxPro.2 or one of its dependencies. 拒绝访问。 原创
-
Exception from HRESULT: 0x800736B1,Could not load file or as
-
Could not load file or assembly 'Microsoft.SqlServer
-
Could not load file or assembly Microsoft.SqlServer.Management.Sdk.Sfc, Version=
-
Could not load file or assembly Microsoft.SqlServer.Management.Sdk.Sfc, Version=