c# - 将 Visual Studio 升级到 15.5 后缺少 System.Net.Http

标签 c# .net asp.net-mvc visual-studio-2017 dotnet-httpclient

我们有一个现有的解决方案,包括一个 ASP.NET MVC 项目和一堆库,所有项目都以 .NET 4.6.1 为目标。

将 Visual Studio 从 15.3 升级到 15.5 后,我收到一些编译错误,指出它找不到 System.Net.Http 程序集。

The type 'HttpResponseMessage' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Net.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.

我读了release notes但我找不到任何会导致这个问题的东西。为什么将 Visual Studio 从 15.3 升级到 15.5 会导致这些错误?

最佳答案

我猜你的问题与这里写的内容有关 https://developercommunity.visualstudio.com/content/problem/160241/errors-reported-when-none-exist.html因为看起来这都是关于项目引用的。请查看是否有建议的解决方案

Uncheck option "Allow parallel project initialization"

对你也有帮助。

顺便说一句,值得一提的是,15.5 更新显然给现有项目带来了其他严重问题,如此处所写 https://developercommunity.visualstudio.com/content/problem/160609/vb-option-strict-on-warnings-are-shown-on-existing.html

我希望所有这些都有助于解决您的问题或至少对其进行更深入的调查。

关于c# - 将 Visual Studio 升级到 15.5 后缺少 System.Net.Http,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47689711/

相关文章:

c# - Excel 互操作阻止显示密码对话框

c# - 使用 Json.NET 序列化泛型类中的 protected 属性

.net - Windows 窗体应用程序的默认字体

asp.net - ASP.NET MVC 中的模拟 User.Identity

c# - 如何将 AngularJS 与 ASP.NET MVC 一起使用?

c# - 为什么我的类数组元素表现得像一个指针? (C#)

c# - 为模型创建一个通用的 Save() 方法

.net - 如何为基于 SQL Server 服务的数据库设置密码?

c# 是否可以创建这样的委托(delegate)?

asp.net-mvc - 如何在 IFrame 中禁用打开的 ASP.NET MVC 站点?