title: The type or namespace name 'Http' does not exist in the namespace 'System.Net' **when compiling with mono**
body: <p>First of all, I did look into all the questions referring to the error <em>error CS0234: The type or namespace name 'Http' does not exist in the namespace 'System.Net'(are you missing an assembly reference?)</em> here on StackOverflow, but my case is a little different.</p>
  
  <p>I have this application that uses Http requests to communicate with a Web API 2  (simple numbers, coordinates). Both applications work perfectly when run on Windows. However, for my project, I need to run the application from the terminal of  <strong>Raspberry Pi 3</strong>.</p>
  
  <p>I tried compiling it with Visual Studio, with and without adding MONO in the <em>Conditional compilation symbols</em> field. - <strong>It runs from terminal but the buttons, listboxes do not react</strong></p>
  
  <p>I compiled it in several different ways, both on windows and on Raspbian Jessie (the OS of the RPi 3): </p>
  
  <pre><code>$ **mcs -pkg:dotnet *.cs**  
  $ **mcs *.cs**  
  $ **C:\Windows\Microsoft.NET\Framework\v4.0.30319\csc.exe /t:exe /out:DroneApp.exe *.cs**  
  $ **mcs -out:hello.exe hello.cs**  
  $ **dmcs ./*.cs -r:/usr/lib/mono/4.0/System.Web.dll**
  $ **xbuild /p:Configuration=Release DroneApp.csproj**
  </code></pre>
  
  <p>and any other way that I could find on the internet (I've spent 2 days doing this so I can't remember all of them).
  I also want to state that I installed the packages mono-devel, mono-complete, eferenceassemblies-pcl, ca-certificates-mono (which deal with Http requests) and mono-xsp4 (for ASP.net applications).</p>
  
  <p><strong>Nothing works :(</strong></p>
  
  <p>All the classes that are used as services to communicate with the server throw me the error <em>The type or namespace name 'Http' does not exist in the namespace 'System.Net'</em> even though I triple checked that all my references are in place. </p>
  
  <p>The target framework of my app is .NET Framework 4.5.</p>
  
  <p><a href="https://i.stack.imgur.com/3v5tE.png" rel="nofollow noreferrer">check this screenshot</a></p>
  
  <p>If you have even a small idea or if I should provide some more information, please help me. Thank you.</p>
  
  <p>Example of one of the service classes that throws the error (all of them are the same)</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Text;
  using System.Threading.Tasks;
  using System.Net.Http;
  using System.Net.Http.Headers;
  
  namespace DroneClientApp.Services
  {
      class PathService
      {
          private const string UserEndPoint = "api/Paths";
          private const string RequestResponseFormat = "application/json";
  
          private readonly string _serverUrl;
  
          public PathService(string serverUrl)
          {
              _serverUrl = serverUrl;
          }
  
      public async Task&lt;List&lt;Path&gt;&gt; GetPathsAsync()
      {
          using (var httpClient = new HttpClient())
          {
              httpClient.BaseAddress = new Uri(_serverUrl);
              httpClient.DefaultRequestHeaders.Accept.Clear();
              httpClient.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue(RequestResponseFormat));
  
              var response = await httpClient.GetAsync(UserEndPoint).ConfigureAwait(false);
              if (response.IsSuccessStatusCode)
              {
                  return await response.Content.ReadAsAsync&lt;List&lt;Path&gt;&gt;().ConfigureAwait(false);
              }
  
              return await Task.FromResult(new List&lt;Path&gt;()).ConfigureAwait(false);
          }
      }enter code here
  </code></pre>