Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HttpClient - .net 4 or .net 4.5

I'm on the Nuget HttpClient page and the information there is seemingly contradictory. 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.

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. For known issues, please see: http://go.microsoft.com/fwlink/?LinkID=279987.

So, it's for "modern apps on [.Net 4] but targets [.Net 4.5]?

What gives?

like image 342
Irwin Avatar asked May 22 '26 10:05

Irwin


1 Answers

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.

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).

like image 53
Jon Avatar answered May 24 '26 00:05

Jon



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!