System.Net.Http: missing from namespace? (using .net 4.5)

后端 未结 16 2225
我寻月下人不归
我寻月下人不归 2020-11-27 17:57

TL; DR: I\'m new to this language and have no idea what I\'m doing

here is my class so far:

using System;
using System.Collections.Generic;
using Sys         


        
相关标签:
16条回答
  • 2020-11-27 18:17

    With the Nuget Package Manager install Microsoft.AspNet.WebApi.Core.

    After this:

    using System.Web.Http;
    

    or if you use VB

    imports System.Web.Http

    0 讨论(0)
  • 2020-11-27 18:21

    HttpClient is new in .net 4.5. You should probably be using HttpWebRequest.

    0 讨论(0)
  • 2020-11-27 18:23

    NuGet > Microsoft.AspNet.WebApi.Client package

    0 讨论(0)
  • 2020-11-27 18:23

    just go to add reference then add

    system.net.http
    

    0 讨论(0)
  • 2020-11-27 18:24

    For me, it was getting the nuget package Microsoft.Net.Http .(https://blogs.msdn.microsoft.com/bclteam/p/httpclient/)

    0 讨论(0)
  • 2020-11-27 18:27

    Make sure it's referenced in your web.config:

    0 讨论(0)
提交回复
热议问题