Search code examples
c#.netmono.net-remoting

.NET Remoting on Mono: Uri already in use


Running:

  • Ubuntu 10.04, 32-bit
  • Mono 2.6.7

I have an application developed in VS 2008 that uses .NET remoting (with a custom RemotingUDPChannel class). We are trying to run this on linux (building in MonoDevelop) now, but I am receiving the following error.

Code causing exception:

this.server = RemotingServices.Marshal(this, objectUri);

Exception:

System.Runtime.Remoting.RemotingException: Uri already in use:

We received this error in the past when running on the Window side if we had multiple remoting apps running, but fixed it by creating a new appdomain for each. However, this does not seem to affect it on the linux side. Also, we are not trying to run multiple remoting apps, just the single one.

Any ideas on this problem? Thanks!


Solution

  • Our workaround to this problem:

    Remove a tag from our remoting config file that causes the remoting object to be added at both

    RemotingConfiguration.Configure(configurationFile, false);
    

    and

    RemotingServices.Marshal(this, objectUri);
    

    The tag removed was:

    <service>
    
       <wellknown mode="Singleton" objectUri="FileSyncer.rem" type="MyLib.FileSyncerServer, MyLib" />
    
    </service>
    

    This only had to be done from the server side.