Hi All,
I got exception when call Activator.GetObject( ... )
When I start my application I register Channel to communicate between
two computers and register type ReceiverLocator for remoting in
Bind()
Then when I need to get reference to this object on remote computer I
call Lookup and get proxy from remote computer.
Lookup() works fine when I start MyApplication.exe from current
folder where MyApplication.exe exists.
But when I start MyApplication from another folder using path to it
(so there is no MyApplication.exe in current folder)
Activator.GetObject() gives me an FileNotFound exception
"File or assembly name MyApplication, or one of its dependencies, was
not found". Copying MyApplication.exe in the folder where I start
MyApplication.exe from does not help.
private bool StartDistributedObjectRegistry(AInt port)
{
ChannelServices.RegisterChannel( new TcpChannel(nPort) );
}
public void Bind()
{
Type t = Type.GetType("Communicator.ReceiverLocator,MyAppli cation");
RemotingConfiguration.RegisterWellKnownServiceType (t,
"ReceiverLocator",WellKnownObjectMode.Singleto n);
}
public static Object Lookup(String name)
{
Object obj = Activator.GetObject(typeof(ReceiverLocator),"tcp:\ \RemoteComputer\ReceiverLocator");
return obj;
}
Any hints on this issue would be greatly appreciated. Need to fix it
quickly.
Thank you in advance
Roman