TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Sylvain Boisse
NA
6
0
FileNotFoundException using Remoting
Nov 25 2005 9:24 AM
Hello,
I have an issue as I am trying to use remotingin my little app. I have the assembly myproject.dll, containing all the necessary implementation for a server and client process to use it for remoting:
interface IMyObject
Contains fct bool Open() prototype
class CMyObject : MarshalByRefObject, IMyObject
Contains fct bool Open() implementation
CMyObjectRemoteClient : IMyObject
Contains Remoting implementation for client side
CMyObjectRemoteServer : CMyObject
Contains Remoting implementation for Server side
I have a first process, the server, instantiating CMyObjectRemoteServer, which does the following:
// Create Ipc Channel
m_oIpcServerChannel = new IpcServerChannel("myproject");
// Register to the IPC channel
ChannelServices.RegisterChannel(m_oIpcServerChannel, false);
//register remote object
RemotingConfiguration.RegisterWellKnownServiceType(
typeof(CMyObjectRemoteServer),
"CMyObject",
WellKnownObjectMode.Singleton);
I have the second process, the client, doing the following:
// Create Ipc Channel
m_oIpcClientChannel = new IpcClientChannel("myproject", null);
// Register to the IPC channel
ChannelServices.RegisterChannel(m_oIpcClientChannel, false);
// Get the remote object
remoteObject = (IMyObject) Activator.GetObject(
typeof(CMyObjectRemoteServer),
"ipc://myproject/CMyObject");
For this part, everything seems to work right. But then I try to call the Open() function of my object:
remoteObject.Open();
And I get the following exception:
1724 RemoteTester. WARNING 18:49:57:246 00e9c MyNamespace::CMyObjectRemoteClient.Open() Error calling remote object function: Could not load file or assembly 'myproject, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
The first process is nothing but an exe using myproject.dll to get a CMyObjectRemoteServer object. The second process is also a simple exe using the same myproject.dll to get a CMyObjectRemoteClient object. Both the client and server exe, and myproject.dll are all in the same folder. I also checked:
typeof(CMyObjectRemoteServer).Assembly.CodeBase
typeof(CMyObjectRemoteClient).Assembly.CodeBase
to find out they really point to the right place, and all looks fine. What is going wrong, and why does it fail loading the assembly?
Thanks for your help!
Reply
Answers (
0
)
How do I know that how many users are online?
Dynamically generation in .Net