Hi All,
I got exception when call Activator.GetOb ject( ... )
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.e xe from current
folder where MyApplication.e xe exists.
But when I start MyApplication from another folder using path to it
(so there is no MyApplication.e xe in current folder)
Activator.GetOb ject() gives me an FileNotFound exception
"File or assembly name MyApplication, or one of its dependencies, was
not found". Copying MyApplication.e xe in the folder where I start
MyApplication.e xe from does not help.
private bool StartDistribute dObjectRegistry (AInt port)
{
ChannelServices .RegisterChanne l( new TcpChannel(nPor t) );
}
public void Bind()
{
Type t = Type.GetType("C ommunicator.Rec eiverLocator,My Application");
RemotingConfigu ration.Register WellKnownServic eType(t,
"ReceiverLocato r",WellKnownObj ectMode.Singlet on);
}
public static Object Lookup(String name)
{
Object obj = Activator.GetOb ject(typeof(Rec eiverLocator)," tcp:\\RemoteCom puter\ReceiverL ocator");
return obj;
}
Any hints on this issue would be greatly appreciated. Need to fix it
quickly.
Thank you in advance
Roman
I got exception when call Activator.GetOb ject( ... )
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.e xe from current
folder where MyApplication.e xe exists.
But when I start MyApplication from another folder using path to it
(so there is no MyApplication.e xe in current folder)
Activator.GetOb ject() gives me an FileNotFound exception
"File or assembly name MyApplication, or one of its dependencies, was
not found". Copying MyApplication.e xe in the folder where I start
MyApplication.e xe from does not help.
private bool StartDistribute dObjectRegistry (AInt port)
{
ChannelServices .RegisterChanne l( new TcpChannel(nPor t) );
}
public void Bind()
{
Type t = Type.GetType("C ommunicator.Rec eiverLocator,My Application");
RemotingConfigu ration.Register WellKnownServic eType(t,
"ReceiverLocato r",WellKnownObj ectMode.Singlet on);
}
public static Object Lookup(String name)
{
Object obj = Activator.GetOb ject(typeof(Rec eiverLocator)," tcp:\\RemoteCom puter\ReceiverL ocator");
return obj;
}
Any hints on this issue would be greatly appreciated. Need to fix it
quickly.
Thank you in advance
Roman
Comment