472,805 Members | 2,121 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,805 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 1194
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...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: erikbower65 | last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps: 1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal. 2. Connect to...
0
linyimin
by: linyimin | last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
0
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Sept 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
5
by: DJRhino | last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer) If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _ 310030356 Or 310030359 Or 310030362 Or...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

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.