简体   繁体   English

HttpClient - .net 4或.net 4.5

[英]HttpClient - .net 4 or .net 4.5

I'm on the Nuget HttpClient page and the information there is seemingly contradictory. 我在Nuget HttpClient页面上 ,其中的信息看似矛盾。 The very first paragraph is: 第一段是:

This package provides a programming interface for modern HTTP applications on .NET Framework 4, Silverlight 4 and 5, Windows Phone 7.5 and 8. This package includes HttpClient for sending requests over HTTP, as well as HttpRequestMessage and HttpResponseMessage for processing HTTP messages. 该软件包为.NET Framework 4,Silverlight 4和5,Windows Phone 7.5和8上的现代HTTP应用程序提供了编程接口。该软件包包括用于通过HTTP发送请求的HttpClient,以及用于处理HTTP消息的HttpRequestMessage和HttpResponseMessage。

But then, the third paragraph says, 但是,第三段说,

This package is not supported in Visual Studio 2010, and is only required for projects targeting .NET Framework 4.5 or .NET for Windows Store apps when consuming a library that uses this package. Visual Studio 2010不支持此程序包,仅在使用使用此程序包的库时,针对.NET Framework 4.5或.NET for Windows Store应用程序的项目才需要此程序包。 For known issues, please see: http://go.microsoft.com/fwlink/?LinkID=279987 . 有关已知问题,请参阅: http//go.microsoft.com/fwlink/?LinkID = 279987

So, it's for "modern apps on [.Net 4] but targets [.Net 4.5]? 那么,它是针对[.Net 4]上的现代应用程序,但目标是[.Net 4.5]?

What gives? 是什么赋予了?

It's for apps that target .NET 4, because .NET 4.5 has these features built-in , so apps targeting 4.5 can just use the version that .NET ships with. 它适用于面向.NET 4的应用程序,因为.NET 4.5 内置了这些功能 ,因此面向4.5的应用程序可以使用.NET附带的版本。

If targeting .NET 4.5, you need the package only when consuming a library that uses this package (obvious: if one of your dependencies depends on HttpClient, then you also depend on HttpClient). 如果针对.NET 4.5,只有在使用使用此软件包的库时才需要软件包 (显而易见:如果您的某个依赖项依赖于HttpClient,那么您还依赖于HttpClient)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM