473,404 Members | 2,174 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,404 software developers and data experts.

Remoting, first attempt and 'type or namespace xxx could not be found'

I know this is a really simple thing but it is not intuitively obvious on
how to do this the first time.

I've created a remote server which lives in an EXE. This compiles.

I've create a client of the remote server which fails to compile due to a
failure of the 'using' line that would import the server class's definition.
I can't figure out how to add the server as a reference because the server
is an EXE, not a DLL.

So - how do I import the class information from my server into my client?
=======
Richard Lewis Haggard
Nov 16 '05 #1
2 1217
Hi,
VS.Net does not allow you to make a reference to .exe. But the c# command
line compiler does.

Also, this is not good approach at all. You have to consider a different
one, I'll order them in the way I do prefer it (1-st one is less
recommended, etc.):

1. Put your remote class in a separate assembly (dll), and reference to it
both from client and server.
2. Put your remote class in a separate assembly. Reference it from the
server. Use soapsuds.exe to extract the metadata from that assembly, and
reference the result from the client. This way you do not ship your
original class with the client. There a lot of problems with soapsuds.exe,
so even it is a possibility, I would not recommend using it.

The next 2 approaches are highly recommended:

3. Create and abstract class, which inherits from MarshalByRefferenceObject
and contains all the methods you are going to use with remoting. Then make
your remote class inherit from it, and reference it from the server. At the
client, reference the abstract class assembly only, and your client will
cast the remoted object to the abstract class. And you will have all needed
to invoke the remote object. And you are not going to ship your code with
the client.
You may take a look to Allen Anderson's article for this:
http://www.glacialcomponents.com/Art...D=RemoteObject

4. This is my favorite. It is very similar to the previous one, but instead
of using abstract class, use interfaces. In my opinion, this is better,
because of the limitations you have with abstract classes (no multiple
inheritances). And is more flexible and scalable.

Also, I'd suggest that you use framework.remoting newsgroup for remoting
related questions. There are a lot of good examples and answers already.
Use groups.google search, or microsoft site for searching.

Hope that helps
Sunny

"Richard Lewis Haggard" <HaggardAtWorldDotStdDotCom> wrote:
I know this is a really simple thing but it is not intuitively obvious on
how to do this the first time.

I've created a remote server which lives in an EXE. This compiles.

I've create a client of the remote server which fails to compile due to a
failure of the 'using' line that would import the server class's
definition. I can't figure out how to add the server as a reference
because the server is an EXE, not a DLL.

So - how do I import the class information from my server into my client?
=======
Richard Lewis Haggard


Nov 16 '05 #2
Excellent response! I do so thank you for your quick, timely and informative
response.
======
"I just got a new car for my wife. Wish I could make a trade like that every
day." - Henny Youngman.
Richard Lewis Haggard

"Sunny" <su******@icebergwireless.com> wrote in message
news:ul**************@TK2MSFTNGP09.phx.gbl...
Hi,
VS.Net does not allow you to make a reference to .exe. But the c# command
line compiler does.

Also, this is not good approach at all. You have to consider a different
one, I'll order them in the way I do prefer it (1-st one is less
recommended, etc.):

1. Put your remote class in a separate assembly (dll), and reference to it
both from client and server.
2. Put your remote class in a separate assembly. Reference it from the
server. Use soapsuds.exe to extract the metadata from that assembly, and
reference the result from the client. This way you do not ship your
original class with the client. There a lot of problems with soapsuds.exe,
so even it is a possibility, I would not recommend using it.

The next 2 approaches are highly recommended:

3. Create and abstract class, which inherits from MarshalByRefferenceObject and contains all the methods you are going to use with remoting. Then make
your remote class inherit from it, and reference it from the server. At the client, reference the abstract class assembly only, and your client will
cast the remoted object to the abstract class. And you will have all needed to invoke the remote object. And you are not going to ship your code with
the client.
You may take a look to Allen Anderson's article for this:
http://www.glacialcomponents.com/Art...D=RemoteObject

4. This is my favorite. It is very similar to the previous one, but instead of using abstract class, use interfaces. In my opinion, this is better,
because of the limitations you have with abstract classes (no multiple
inheritances). And is more flexible and scalable.

Also, I'd suggest that you use framework.remoting newsgroup for remoting
related questions. There are a lot of good examples and answers already.
Use groups.google search, or microsoft site for searching.

Hope that helps
Sunny

"Richard Lewis Haggard" <HaggardAtWorldDotStdDotCom> wrote:
I know this is a really simple thing but it is not intuitively obvious on how to do this the first time.

I've created a remote server which lives in an EXE. This compiles.

I've create a client of the remote server which fails to compile due to a failure of the 'using' line that would import the server class's
definition. I can't figure out how to add the server as a reference
because the server is an EXE, not a DLL.

So - how do I import the class information from my server into my client? =======
Richard Lewis Haggard

Nov 16 '05 #3

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

Similar topics

4
by: Uchiha Jax | last post by:
Hello everyone, I am a plenty silly person who is trying to learn .NET remoting through trial and error (all articles I read are going over my head at the moment (mostly) so I thought i'd give...
15
by: Ron L | last post by:
We are working on a distributed VB.Net application which will access a SQL database located on a known server. Each client will run on the user's local machine. To implement this, we are trying...
15
by: Ron L | last post by:
We are working on a distributed VB.Net application which will access a SQL database located on a known server. Each client will run on the user's local machine. To implement this, we are trying...
30
by: Ron L | last post by:
We are working on a distributed VB.Net application which will access a SQL database located on a known server. Each client will run on the user's local machine. To implement this, we are trying...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.