MSDN .Net Remoting Sample ?

S

swartzbill2000

Hello,
I am trying to build and run the Remoting Sample from MSDN. Everything
compiles. The Listener appears to run. The Client throws this
RemotingException:

A first chance exception of type
'System.Runtime.Remoting.RemotingException' occurred in mscorlib.dll
RemotingException.Message
Cannot load type 'RemotableType, RemotableType'.
RemotingException.StackTrace

Server stack trace:
at
System.Runtime.Remoting.RemotingConfigHandler.RemotingConfigInfo.LoadType(String
typeName, String assemblyName)
at
System.Runtime.Remoting.RemotingConfigHandler.RemotingConfigInfo.GetServerTypeForUri(String
URI)
at
System.Runtime.Remoting.RemotingConfigHandler.GetServerTypeForUri(String
URI)
at
System.Runtime.Remoting.RemotingServices.GetServerTypeForUri(String
URI)
at
System.Runtime.Remoting.Channels.SoapServerFormatterSink.ProcessMessage(IServerChannelSinkStack
sinkStack, IMessage requestMsg, ITransportHeaders requestHeaders,
Stream requestStream, IMessage& responseMsg, ITransportHeaders&
responseHeaders, Stream& responseStream)

Exception rethrown at [0]:
at
System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage
reqMsg, IMessage retMsg)
at
System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData&
msgData, Int32 type)
at RemotableType.RemotableType.StringMethod()
at Client.Client.Form1_Load(Object sender, EventArgs e) in
C:\Documents and Settings\Owner\My Documents\Visual Studio
2005\Projects\RhsRemotingTest\Client\Client\Client.vb:line 13

Any ideas?
Bill
 
G

gregory_may

My suggestion is not to use remoting.

I have done some work with it ... I would look into Indigo, Windows
Communication Foundation instead.
 
S

swartzbill2000

You may have a point. With my current problem,
'Activator.CreateInstance' returns its System.Object without throwing
an exception. 'CType' casts the System.Object to the particular type
without throwing an exception either. When I try to use the instance of
the particular type, everything hangs. Has anyone seen this before?
Bill
 
C

CMM

Nonsense. Remoting is extraordinarily easy. It's insane how easy it is.

Without seeing your code there's no way to tell what you're doing wrong. Is
your remote class inheriting MarshalByRefObject, did you create a simple Exe
host or are you using IIS... lots of questions. Is the remote on a different
machine, is it firewalled?

I'd forget using a "sample" and create your own starting point by hand.
You'll learn a lot more.
http://www.thinktecture.com/Resources/RemotingFAQ/default.html
 
G

Guest

Absolutely agree with CMM. Remoting has some different concepts that a
beginner or even intermediate program might struggle with, but it is a
extremly good solution if you have to pass objects across different app
domains.

Also post your client code.
 
P

Phill W.

Hello,
I am trying to build and run the Remoting Sample from MSDN. Everything
compiles. The Listener appears to run. The Client throws this
RemotingException:

Actually, the client is implicitly catching the exception and rethrowing it
:)

(Haven't seen the example, but)
Are you using your own process to host the Remote Component, or IIS.

Is your remote Component added to the Global Assembly Cache or in
the same [application] directory as your host process?

Are you doing any of the remoting "work" yourself or just using

RemotingConfiguration.Configure()

and letting the Framework do it all for you?

Regards,
Phill W.
 
S

swartzbill2000

I am using my own process.
The remote component is not in the GAC.
I got rid of 'RemotingConfiguration.Configure()' and am getting
further.
I am starting over and making my own (component,server,client) sample.
I will repost new problems.
Bill
 
S

swartzbill2000

I now have a working simple (RemotableType,Listener,Client) sample. The
RemotableType resides in a DLL. Both the Listener and Client have
references to the DLL. I want to remove the Client dependency on the
DLL by using an interface I call IRemotable. RemotableType now
Implements the interface. I added IRemotable.vb to the Client. Now
'Activator.GetObject' appears to succeed, as does 'DirectCast' to cast
the Object to IRemotable. The first method call fails with this info:
RemotingException.Message
Cannot load type 'Client.IRemotable, Client, Version=1.0.0.0,
Culture=neutral, PublicKeyToken=null'.

How can I fix it?
Bill
 
G

Guest

So, I am have the same problem... what sucks for me is that you did not post
your solution to the original problem. Could you post your working code. Once
I have remoting working properly I will need to implement an interface as you
described. But first things first, how did you solve your "Cannot load type"
problem?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top