title: erlang rpc call to static member function of c# class using NFX
body: <p>I'm trying to call c# static member function from erlang using nfx. I follow doc <a href="http://blog.aumcode.com/2013/10/nfx-native-interoperability-of-net-with.html" rel="nofollow">http://blog.aumcode.com/2013/10/nfx-native-interoperability-of-net-with.html</a> and I am able to call erlang:now from C# and System.DateTime.UtcNow from erlang. However when I try to call non-System from erlang, I get error</p>
  
  <p>** exception error: no match of right hand side value {error,
                                                         "unknown type: 'Program'"}</p>
  
  <p>C# code:</p>
  
  <pre><code>namespace erlangIntegration {
  public class Program {
      static void Main(string[] args) {
          var n = new ErlLocalNode("abc", new ErlAtom("'asdf'"));
          n.AcceptConnections = false;
          n.Start();
  
          var m = n.CreateMbox("test");
          var r = m.RPC("r@myPC", "erlang", "now", new ErlList());
  
          Console.WriteLine("Remote time: {0}", r.ValueAsDateTime.ToString());
  
          System.Console.WriteLine("My simple rpc: " + Program.FixedDate());
          System.Console.WriteLine("Done. Press any key to exit.");
          System.Console.ReadKey();
      }
      public static DateTime FixedDate() {
          return new DateTime(2000, 12, 12);
      }
  }
  </code></pre>
  
  <p>}</p>
  
  <p>erlang calls:</p>
  
  <pre><code>(r@myPC)2&gt; f(Time), {ok, Time} = rpc:call('abc@myPC', 'System.DateTime', 'UtcNow', []), calendar:now_to_local_time(Time).
  </code></pre>
  
  <p>Above call works returning {{2016,1,18},{11,33,17}}
  However </p>
  
  <pre><code>(r@myPC)12&gt; f(Time), {ok, Time} = rpc:call('abc@myPC', 'Program', 'FixedDate', []), calendar:now_to_local_time(Time).
  </code></pre>
  
  <p>returns error:
  ** exception error: no match of right hand side value {error,
                                                         "unknown type: 'Program'"}</p>
  
  <p>I also tried erlangIntegration.Program and to use System namespace.
  How to properly make rpc call to c#?</p>