Re: remoting options



Sorry to reply to my own post, but I've thought about it and I think I can see a bit where you're coming from;

peter wrote:

Do you have the following lines (or their VB equivalent) somewhere in your code (hopefully in Application_start()):


string path = Server.MapPath("config_file_name");
RemotingConfiguration.Configure(path);

As I've said, I don't use IIS, so I'm speaking a bit without the book here. Still, that's never stopped me before :)


The problem as I see it is that you've got IIS acting as both server and client. I don't even know if this is possible.

I also don't know if you can use a configuration file on the client side for a remote object hosted in IIS: although I don't see why not. If you were to do this, that config file would *not* be web.config. Putting client-side remoting configuration details in web.config does not work (or so I'm told). The client side config file would look something like this:

<configuration>
	<system.runtime.remoting>
		<application>
			<client>
				<wellknown
	type="fully.qualified.type.name, locationOfTheType"
	url="http://localhost/objectURI.rem";
				/>
			</client>
		</application>
	</system.runtime.remoting>
</configuration>

If you have a config file like this and are then using the two lines I put in my previous post (above), then you're configuring remoting on the client side through a config file.

If you are not using a config file, then you need some lines like this in your code:

HttpClientChannel channel = new HttpClientChannel();
ChannelServices.RegisterChannel(channel);

myObj = (myObj)Activator.GetObject(typeof(myObj), @"http://localhost/path/to/objectURI.rem";);

(You'll need the VB equivalent, of course, but it's very similar.)

You'll also need a reference to your proxy|interface|abstract base class in your client project references (*not* to the object itself, although it would probably work in this case).

If none of the above makes sense, my advice is to try to create a simple console application client with just enough code in it to prove that it's getting a constructive response from the remote object.

If you don't have lines in your client like:

RemotingConfiguration.Configure(path);

or (alternatively)

myObj = (myObj)Activator.GetObject(typeof(myObj), @"http://......";);

Then I can't see how you're making a remote call. Without knowing the full story, I would suspect in this case that you're actually making a local call to a dll referenced in your client code.


HTH


Peter .



Relevant Pages

  • Re: remoting options
    ... No I did not add a reference to the remote object in my client ... I just copied it into the bin directory on my client. ... > * Create an interface dll for your remote object. ...
    (microsoft.public.dotnet.distributed_apps)
  • Bidirectional communications with .NET remoting
    ... I have a remote object that has a public delegate. ... BinaryServerFormatterSinkProvider serverProvider = new ... My client object uses ... client-side config file is not appropriately set in the config file. ...
    (microsoft.public.dotnet.framework.remoting)
  • Re: remoting options
    ... I suspect you've added a reference to the remote object. ... Reference the interface in your client project. ... * Create an abstract base class dll for your remote object that contains declarations for all the public methods of your class. ...
    (microsoft.public.dotnet.distributed_apps)
  • RE: .NET Remoting problem - exception "Object Reference not set to ins
    ... client or server side .config files). ... and in the client side access the object through this ip address. ... Please compare the same with your config file. ... and implementing an object from the General namespace. ...
    (microsoft.public.dotnet.framework)
  • Re: Question about remoting using channels
    ... remote object of that type. ... When you call some methods using the same reference your calls will not go ... on the server necessarily to the same server object. ... using the same client reference can go to three different server objects. ...
    (microsoft.public.dotnet.framework.remoting)

Loading