title: Remoting in C# not working
body: <p>I am learning about using Remoting in .NET. I have built a small application which does a basic hello world work.
  the code for RemoteObject is :</p>
  
  <pre><code>public class MyRemoteObjectClass:MarshalByRefObject
      {
          public MyRemoteObjectClass()
          {
              Console.WriteLine("Remote object created");
          }
          //return message reply
          public String ReplyMessage(String msg)
          {
              Console.WriteLine("Client : " + msg);//print given message on console 
              return "Server : Yeah! I'm here";
          }
      }
  </code></pre>
  
  <p>The code for server class is:</p>
  
  <pre><code>class MyServerClass
      {
          public MyServerClass()
          {
          }
          static void Main(string[] args)
          {
              RemotingConfiguration.Configure("RemotingSettings_Server.xml",false);
              Console.WriteLine("server activated");
              Console.ReadLine();
          }
      }
  </code></pre>
  
  <p>The source code for client class is:</p>
  
  <pre><code>class MyClientAppClass
      {
          static void Main(string[] args)
          {
              RemotingConfiguration.Configure("ClientSettings.xml",false);
              Console.WriteLine("Settings read successfully");
              MyRemoteObjectClass remObject = (MyRemoteObjectClass)Activator.GetObject(typeof(MyRemoteObject.MyRemoteObjectClass),"http://localhost:8989/MyRemoteObjectClass",WellKnownObjectMode.Singleton);
              if (remObject == null)
                  Console.WriteLine("cannot locate server");
              else
              { String res = remObject.ReplyMessage("You there?"); Console.WriteLine(res); Console.ReadLine(); }
  
          }
      }
  </code></pre>
  
  <p>My config files for server and client respectively are:</p>
  
  <pre><code>&lt;configuration&gt;
     &lt;system.runtime.remoting&gt;
        &lt;application&gt;
           &lt;service&gt;
              &lt;wellknown 
                 mode="Singleton" 
                 type="MyRemoteObject.MyRemoteObjectClass, MyRemoteObjectClass" 
                 objectUri="MyRemoteObjectClass.rem"
              /&gt;
           &lt;/service&gt;
           &lt;channels&gt;
              &lt;channel ref="http" port="8989"/&gt;
           &lt;/channels&gt;
        &lt;/application&gt;
     &lt;/system.runtime.remoting&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p>client:</p>
  
  <pre><code>&lt;configuration&gt;
    &lt;system.runtime.remoting&gt;
      &lt;application&gt;
        &lt;client&gt;
          &lt;wellknown
             type="MyRemoteObject.MyRemoteObjectClass, MyRemoteObjectClass"
             url="http://localhost:8989/MyRemoteObjectClass.rem"
              /&gt;
        &lt;/client&gt;
      &lt;/application&gt;
    &lt;/system.runtime.remoting&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p>I first built the DLL for the remote object, copied the DLL in both server and client exe locations. I ran server then and then ran client. Server is instantiated but client program thtows exception saying "Remoting Exception:Requested service not found".</p>
  
  <p>Please help me solve this and may be a good place to learn the remoting concepts clearly.</p>
  
  <p>Thanks,
  Rakesh.</p>