title: Why am I getting The type or namespace name `ServiceModel' does not exist in the namespace `System'?
body: <p>I'm trying to compile my c# program using mono inside a docker container.</p>
  <p>I have this file inside my Server directory</p>
  <p>Server.cs</p>
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.ServiceModel;
  using System.Text;
  using System.Threading.Tasks;
  
  namespace SoapServer
  {
      [ServiceContract]
      public interface ISoapServerService 
      {
          [OperationContract]
          string SayHello(string name);
          [OperationContract]
          string CreateRoom();
          [OperationContract]
          List&lt;int&gt; ListRooms();
          [OperationContract]
          bool JoinRoom();
          [OperationContract]
          string Message(string msg);
  
      }
      
      public class SoapServerService : ISoapServerService
      {
          public string SayHello(string name)
          {
              Console.WriteLine(&quot;{0}, is saying Hello.&quot;,name);
              return string.Format(&quot;Hello, {0}&quot;, name);
          }
  
          public string CreateRoom()
          {
              Random rand = new Random();
              Console.WriteLine(&quot;CreateRoom called&quot;);
              //create room etc logic here
              return string.Format(&quot;Room Created, {0}&quot;, rand.Next(100));
          }
          
  
          public List&lt;int&gt; ListRooms()
          {
              Random rand = new Random();
              Console.WriteLine(&quot;ListRooms called&quot;);
              //looop through rooms
              return new List&lt;int&gt;() { rand.Next(1000), rand.Next(1000) };
          }
  
          public bool JoinRoom()
          {
              Console.WriteLine(&quot;JoinRoom called&quot;);
              Random rand = new Random();
              //add busineess logic
              return rand.Next(100) &lt; 50 ? true : false;
          }
  
          public string Message(string msg)
          {
              Console.WriteLine(&quot;Message received:&quot; + msg);
              return &quot;Message recievied:&quot; + msg;
          }
      }
  }
  </code></pre>
  <p>and Program.cs</p>
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Text;
  using System.Threading.Tasks;
  using System.ServiceModel;
  using System.ServiceModel.Description;
  
  
  namespace SoapServer
  {
      
     
  
       internal class Program
      {
          static void Main(string[] args)
          {
              Uri baseAddress = new Uri(&quot;http://localhost:8080/&quot;);
              // Create the ServiceHost.
              using (ServiceHost host = new ServiceHost(typeof(SoapServerService), baseAddress))
              {
                  // Enable metadata publishing.
                  ServiceMetadataBehavior smb = new ServiceMetadataBehavior();
                  smb.HttpGetEnabled = true;
                  smb.MetadataExporter.PolicyVersion = PolicyVersion.Policy15;
                  host.Description.Behaviors.Add(smb);
  
                  // Open the ServiceHost to start listening for messages. Since
                  // no endpoints are explicitly configured, the runtime will create
                  // one endpoint per base address for each service contract implemented
                  // by the service.
                  host.Open();
  
                  Console.WriteLine(&quot;The service is ready at {0}&quot;, baseAddress);
                  Console.WriteLine(&quot;Press &lt;Enter&gt; to stop the service.&quot;);
                  Console.ReadLine();
  
                  // Close the ServiceHost.
                  host.Close();
              }
          }
      }
  }
  </code></pre>
  <p>I have no issues compiling Service.cs into a library file, but when I try to run <code>mcs Program.cs -r:Service.dll</code> I get this message</p>
  <p>Program.cs(6,14): error CS0234: The type or namespace name <code>ServiceModel' does not exist in the namespace </code>System'. Are you missing <code>System.ServiceModel' assembly reference? Program.cs(7,14): error CS0234: The type or namespace name </code>ServiceModel' does not exist in the namespace <code>System'. Are you missing </code>System.ServiceModel' assembly reference?
  Compilation failed: 2 error(s), 0 warnings</p>
  <p>I don't understand why I'm getting this? I'm using visual studio code and mno through docker. Most solution I found consisted in installing a package to Visual studio, but that does not apply to me.</p>