0

I can't install the package System.Net.Http.WebRequest. Help!

$ dotnet add package System.Net.Http.WebRequest
  Writing /tmp/tmp91vAjR.tmp
info : Adding PackageReference for package 'System.Net.Http.WebRequest' into project '/home/porton/Projects/ii/BravoDB/BravoDBDebug/BravoDBDebug.csproj'.
info : Restoring packages for /home/porton/Projects/ii/BravoDB/BravoDBDebug/BravoDBDebug.csproj...
info :   GET https://api.nuget.org/v3-flatcontainer/system.net.http.webrequest/index.json
info :   NotFound https://api.nuget.org/v3-flatcontainer/system.net.http.webrequest/index.json 1264ms
error: Unable to find package System.Net.Http.WebRequest. No packages exist with this id in source(s): nuget.org
error: Package 'System.Net.Http.WebRequest' is incompatible with 'all' frameworks in project '/home/porton/Projects/ii/BravoDB/BravoDBDebug/BravoDBDebug.csproj'.
porton
  • 5,214
  • 11
  • 47
  • 95
  • 3
    Huh. If you're talking about `System.Net.HttpWebRequest`, then it's not a NuGet package. Though nowadays I would expect you'd want to use `HttpClient`. – ProgrammingLlama Aug 02 '19 at 06:28
  • @John Does it mean that I need to install `System.Net.Http.WebRequest.dll ` manually (not through NuGet)? – porton Aug 02 '19 at 06:30
  • @porton you need to find Nuget package which contains that binary and install it through package manager – OlegI Aug 02 '19 at 06:32
  • 1
    I agree with John on `HttpClient`. Here is a nice post about it. https://learn.microsoft.com/en-us/dotnet/architecture/microservices/implement-resilient-applications/use-httpclientfactory-to-implement-resilient-http-requests – Silvermind Aug 02 '19 at 06:38
  • @John http://www.binaryintellect.net/articles/0f52c5bf-b7a4-4720-9572-6159b1804d1d.aspx – porton Aug 02 '19 at 06:40
  • 2
    It seems that `WebRequestHandler` is a _.NET Framework_ thing. Looking at [this post](https://stackoverflow.com/questions/43272530/whats-the-alternative-to-webrequesthandler-in-net-core), and the fact that it's not available in the .NET Core docs, only the [.NET Framework docs](https://learn.microsoft.com/en-us/dotnet/api/system.net.http.webrequesthandler?view=netframework-4.8&viewFallbackFrom=netcore-2.2). – ProgrammingLlama Aug 02 '19 at 06:45

0 Answers0