Following works for me, what exception is thrown on you?
// rdomas.cs
using System;
using System.Reflection;
namespace Willys {
public class HelloWorldWorker : MarshalByRefObject
{
string s;
public string S
{
get { return s;}
}
public void SayHello(HelloWorldWorker w)
{
this.s = "Hello";
this.s = w.S;
this.s = w.s + " world";
}
}
}
// main.cs
....
public static void Main()
{
AppDomain newDomain = AppDomain.CreateDomain("Second AppDomain");
HelloWorldWorker remote =
(HelloWorldWorker)newDomain.CreateInstanceAndUnwra p("rdomas",
"Willys.HelloWorldWorker");
remote.SayHello(remote);
Console.WriteLine(remote.S);
}
Willy.
"Howard Swope" <howardsnewsATspitzincDOTcom> wrote in message
news:uU*************@TK2MSFTNGP12.phx.gbl...
I came across an interesting bug I thought I would throw out there. It
occurs when you are remoting a parameter that is of the same type of the
class that is being called for example the first line of the Copy routine
succeeds where the second fails:
class MyType() : MarshalByRefObject
{
private string name;
public MyType()
{
}
public Copy(MyType myType)
{
// succeeds
this.name = myType.Name;
// throws exception if the myType is a remoting proxy
this.name = myType.name;
}
public string Name
{
get
{
return name;
}
}
}
--
Howard Swope [howardsnewsATspitzincDOTcom]
Software Engineer
Spitz, Inc [http://www.spitzinc.com]