473,378 Members | 1,462 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,378 software developers and data experts.

Remoting and the InvokeMember method

I can't use Type.InvokeMember(...) on a remote object.

But when I use Type.InvokeMember(...) on a non-remote object in the
exact same way, I don't have a problem.

Does someone know what I'm doing wrong? Or if using InvokeMember on a
remote object is just a bad idea?

The reason I wish to use InvokeMember rather than to call the method
directly is because I don't want to install the assembly describing
the remote object (in my example, this file is:
Programming_CSharp.ICalc.dll) on the client machine.

HERE IS THE CLIENT-SIDE CODE THAT DOESN'T WORK:
MarshalByRefObject calcObj =
(MarshalByRefObject) RemotingServices.Connect(
typeof(MarshalByRefObject),
"http://localhost:65100/theCalculator");

double sum = (double)calcObj.GetType().InvokeMember("Add",
BindingFlags.Instance | BindingFlags.Public |
BindingFlags.InvokeMethod,
null,
calcObj,
new object [] {3.0,4.0});

THE TYPE OF THE REMOTE OBJECT IS DEFINED ON THE SERVER AS FOLLOWS:
public class Calculator : MarshalByRefObject, ICalc

HERE IS THE ERROR MESSAGE I'M GETTING:
Method System.MarshalByRefObject.Add not found.
Any help would be greatly appreciated,
Jared
Nov 16 '05 #1
0 1654

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

Similar topics

2
by: Robert May | last post by:
We have a VB6 COM component that I don't have control over. All of the values are returned from method calls using byref parameters. They frequently break binary compatibility, in fact, there are...
0
by: nic | last post by:
Hello, I have a problem with remoting and also with building an interface. My ComponentServer is hosted via an IIS. I wrote my first interface to use it in the client. And the testfunct...
1
by: Robert May | last post by:
We have a VB6 COM component that I don't have control over. All of the values are returned from method calls using byref parameters. They frequently break binary compatibility, in fact, there are...
0
by: Jared Hagel | last post by:
I can't use Type.InvokeMember(...) on a remote object. But when I use Type.InvokeMember(...) on a non-remote object in the exact same way, I don't have a problem. Does someone know what I'm...
0
by: Alex Zhitlenok | last post by:
Hi, On Google, one can find a lot of statements that Invoke and InvokeMemeber work alike. However, my own experience contradicts this statement. 1. Surprisingly, Invoke and InvokeMember methods...
3
by: Laurent | last post by:
Hello, I'm having a problem trying to call a DLL assembly from a C# code with some special parameters. I have a global class used to store some parameters and work with them: public class...
0
by: Pat Ireland | last post by:
I continue to investigate issues with making explicit InvokeMember calls (necessary when dynamically loading classes). My quest lets me use a simple class to invoke another class's member method...
3
by: Patrick Ireland | last post by:
I am dynamically loading a class. One of the methods of the class takes a short * (by reference) argument. However, the InvokeMember call used to invoke the method of the class passings arguments...
1
by: Jan | last post by:
When I use Type.InvokeMember from my remoting server object I get a MissingMethodException: "Method '<namenot found.". My code works when the code is called normally, but not when executed from...
4
by: adiel_g | last post by:
I am trying to set a value on a structure object dynamically using InvokeMember. After I call InvokeMember, the value on the Admin flag does not get updated. Here is the following sample code to...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.