我最初使用4.6.1框架开发项目,但是我想要的Nuget软件包之一要求使用新的4.7.2框架。结果,我升级了我的项目,该项目在尝试再次运行并发送HTTP请求时出现错误:
System.IO.FileNotFoundException: 'Could not load file or assembly 'System.Net.Http,
Version=4.2.0.0, Culture=neutral, PublicKeyToken=**********' or one of its
dependencies. The system cannot find the file specified.'
我该如何解决? (如果我降级到4.6.1,它可以工作,并且我还尝试在使用4.7.2 Framework的同时卸载并重新安装System.Net)
答案 0 :(得分:0)
在app.config中更改:
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
到
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.1" />