473,569 Members | 2,768 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1219
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 MarshalByReffer enceObject
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.remot ing 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" <HaggardAtWorld DotStdDotCom> 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******@icebe rgwireless.com> wrote in message
news:ul******** ******@TK2MSFTN GP09.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 MarshalByReffer enceObject 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.remot ing 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" <HaggardAtWorld DotStdDotCom> 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
3107
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 it a go). What I want to do is this: Have a server instance of the program, this server instance will receive communication from client programs...
15
2387
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 to use remoting for our access to the SQL server, with the remoting being via IIS. Since all of our users will have accounts in the destination...
15
1268
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 to use remoting for our access to the SQL server, with the remoting being via IIS. Since all of our users will have accounts in the destination...
30
2172
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 to use remoting for our access to the SQL server, with the remoting being via IIS. Since all of our users will have accounts in the destination...
0
7694
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7609
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8118
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7964
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6278
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5504
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5217
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
1
2107
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
936
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.