473,396 Members | 1,748 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

FileNotFound exception when remoting

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
Nov 15 '05 #1
2 2106
Roman Muntyanu wrote:
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


My thoughts are as follows. What is typeof(ReceiverLocator)? More
precise, what assembly contains the type ReceiverLocator? I think you
have some assembly containing the type and just it is not found by CLR.
MSDN says: "Application base, which is the root location where the
application is being executed" Maybe the "base" is assumed as the
current folder, which is not the one where your MyApplication.exe is
located.
Maybe you should change the current folder to your application's one.
Check variants of using CMD or link to start it.
If you know where your application will be deployed, you may use
privatePath key in web.config

Dmitry.

Nov 15 '05 #2
Thanks Dmitry for quick response

Actually ReceiverLocator class is in MyApplication.exe assembly.
And I need to start MyApplication from different places:first where it
is located and second using specific path

MyApplication is desktop application. And you pointed me to right point.
I need to use AppendPrivatePath for the domain. Will try, should work

Thank you very much
Roman

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 15 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Tom | last post by:
I load an assembly via Assembly assembly=Assembly.LoadFile(assemblyName); .... foreach(Type t in types) { attribs=t.GetCustomAttributes(typeof(MayaPanelAttribute),true); }
12
by: SJD | last post by:
I've just read Christoph Schittko's article on XmlSerializer: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnxmlnet/html/trblshtxsd.asp . . . and very informative it is too....
1
by: Salvador Ponticelli | last post by:
In an ASP.NET Application I have an instance of a remoting object. After the instance was created, I saved it in a Session variable. When I try to use this instance with the Remoting Service down,...
0
by: Simon Stewart \(C# MVP\) | last post by:
Hi Our scenario is: Various business objects on a server using interfaced-based remoting being called by a thick Windows client - all written in .NET 1.1. Objects are running under a domain...
0
by: Mike Grishaber | last post by:
I am using .NET Remoting to connect my incoming HTTP Requests to my business logic. I am using a custom IHttpAsyncHandler to receive the incoming HTTPRequests and then I forward the...
0
by: stand__sure | last post by:
in re-reading something on .NET remoting I realized that I had done nothing with lease sponsorship and renewal. so, I dug around in msdn2 and found this topic...
4
by: Sharon | last post by:
Hi, I'm using the remoting, and I have a remoting object that has a public event that other processes should register to it. But when the client process is registering to the remote event, it...
1
by: ropo | last post by:
I have a class library used by a windows service executable, both binaries and dependancies are in one bin directory located on c:. 1) I can run a test app on my class library without failure 2)...
0
by: senpark15 | last post by:
Hi EveryBody, I am developing .net remoting application.I have Created server and client application. Server has installed on Two Pc's and cliient have to connect two Pc's and do some...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.