[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.remoting

Re: Remoting or windows service

Elp

7/20/2004 6:09:00 PM

Hiten wrote:
> Anybody has idea on difference between .net remoting and .net windows
> service?

None. These are totally different things. It's like trying to compare a car
and a house. Have you really done any research on .NET Remoting and Windows
Services? Because there are loads of web sites that explain what they are.

In short: a windows service is a particular kind of Windows application that
has no user interface and runs in the background regardless of the logged in
user (which means that a Windows service can run even if there is no user
logged in). They are usually used for server applications. A typical example
would be a Web Server application: it has to run all the time as soon as the
computer is started, doesn't need to have any user interface and doesn't
care to know if a user is logged on or not. Under Windows NT/2000/XP, go to
the control panels -> administrative tools -> services to see the list of
all windows services installed on your computer.

..NET Remoting is a framework that allow you to communicate between 2 .NET
applications (which can be either Windows applications, Windows services or
an ASP .NET applications). More precisely, .NET Remoting allows you to
expose, from the server application, objects that can be used by your client
application (which can be located on the same or on another computer).

> Can I instantiate class and methods of a windows service application
> from C#? if yes then how??

No. But you could in your windows Service, expose your classes/objects via
..NET Remoting, allowing client applications to instanciate/use them.

> and would it be capable of exchanging
> object across processe boundries?

No. But .NET Remoting does that.

Look on the code project web site for introduction articles about .NET
remoting and windows services: http://www.codep...



9 Answers

kiln

7/20/2004 6:47:00 PM

0

I'm also completely new to remoting...one thing I was wondering, with
remoting it would seem that there are two almost separate programs
involved, the client and the server. So, how does one build such an app?
I have vs.net but I'm just wondering about the mechanics of how they are
developed. Does vs.net provide a way to work with the client end and the
server end at the same time, or does one build out the server end first
and then the client interface?

BTW your rundown on the differences between remoting and services was
good.

I was wondering, is are there are any demo apps up on the web, that
allow guest users get the client app, log in, and enter junk data? I'd
be a kick to see it in action.

In article <OBnMqSobEHA.2940@TK2MSFTNGP10.phx.gbl>,
rockfamily@REMOVEME.hotmail.com says...
> Hiten wrote:
> > Anybody has idea on difference between .net remoting and .net windows
> > service?
>
> None. These are totally different things. It's like trying to compare a car
> and a house. Have you really done any research on .NET Remoting and Windows
> Services? Because there are loads of web sites that explain what they are.
>
> In short: a windows service is a particular kind of Windows application that
> has no user interface and runs in the background regardless of the logged in
> user (which means that a Windows service can run even if there is no user
> logged in). They are usually used for server applications. A typical example
> would be a Web Server application: it has to run all the time as soon as the
> computer is started, doesn't need to have any user interface and doesn't
> care to know if a user is logged on or not. Under Windows NT/2000/XP, go to
> the control panels -> administrative tools -> services to see the list of
> all windows services installed on your computer.
>
> .NET Remoting is a framework that allow you to communicate between 2 .NET
> applications (which can be either Windows applications, Windows services or
> an ASP .NET applications). More precisely, .NET Remoting allows you to
> expose, from the server application, objects that can be used by your client
> application (which can be located on the same or on another computer).
>
> > Can I instantiate class and methods of a windows service application
> > from C#? if yes then how??
>
> No. But you could in your windows Service, expose your classes/objects via
> .NET Remoting, allowing client applications to instanciate/use them.
>
> > and would it be capable of exchanging
> > object across processe boundries?
>
> No. But .NET Remoting does that.
>
> Look on the code project web site for introduction articles about .NET
> remoting and windows services: http://www.codep...
>
>
>
>

Elp

7/21/2004 11:57:00 AM

0

kiln wrote:
> I'm also completely new to remoting...one thing I was wondering, with
> remoting it would seem that there are two almost separate programs
> involved, the client and the server.

Well, the whole point of .NET Remoting is to make 2 or more applications
communicate with each other. I guess that you can use remoting to make an
application communicate with itself but i don't really the point of doing
that. So yes, there are usually at least 2 seperate programs involved when
you play with .NET Remoting.

> app? I have vs.net but I'm just wondering about the mechanics of how
> they are developed. Does vs.net provide a way to work with the client
> end and the server end at the same time, or does one build out the
> server end first and then the client interface?

Building a .NET application is done in 3 steps. Imagine that you have a
class BookingManager that contains a method MakeBooking() and that you want
to host this class on a server application to allow any client application
on the web or on your LAN to call the MakeBooking method. Here are the 3
steps to be taken to do that:

1) Define the interface that describe your BokkingManager class so that both
the client and server apps now what you are talking about
2) Implement this class in the server app and say that it can be accessed
via .NET Remoting
3) Create a client app that connects to the server and call the MakeBooking
method

That's it. This means that you'll have to create 3 projects: one for the
interface of your remote object (here the BookingManager class), one for the
client application and one for the server application. How you manage those
3 projects is up to you. You can put them in 3 seperate solutions (in this
case you'll have to have 3 instances of visual studio open at the same time
if you want to work on the 3 projects at the same time) or you can put them
all in the same solution in which case they will all appear in the same
window of Visual Studio. You can implement the server app before the client
app or the client app before the server app but in any case you'll need to
first design the interface of your remote object.

I'm not going to give you any sample code or detailled explanation because:
1) i'm not a very good teacher
2) there are already plenty of tutorials for beginners in .NET Remoting on
the web (look at the code project web site for example)

> I was wondering, is are there are any demo apps up on the web, that
> allow guest users get the client app, log in, and enter junk data? I'd
> be a kick to see it in action.

This would be something trivial to do but i've never heard of anything like
that before for .NET Remoting. Maybe there is somewhere... Anyway, most
tutorials offer you to download already done projects that you can simply
compile and build to see that in action.... but pray for it to work before
because, as anything related network programming, these things tend to work
only on the author's machine, especially when you are a beginner :-)


Elp

7/21/2004 12:14:00 PM

0

Hiten wrote:
> Thanks for the response. I know that in VB6 I can create instance of
> windows service using late binding (the service exe is an active X
> exe) and I was wondering if I can do somewhat similar to that in
> .net.

I don't know anything about VB6 so i can't comment on that. However, i've
never heard of such a thing being done in .NET.

> Both the applications are running on same box, so there won't
> be object exchange out of box.

So what you want is to have an object hosted in a Windows Service and access
it from another application on the same machine? In this case, .NET Remoting
is generally the recommended way provided that you want a *100% .NET
solution*. This is an important detail to note because only .NET
applications can communicate with another application via .NET Remoting.
Forget about having a client application in Java or anything else than .NET
if you use .NET Remoting. The great advantage of .NET Remoting is that it is
generally very simple to develop and deploy (it's built in the .NET
Framework).


> How about creating COM+ enterprise serviced component and running
> that as .NET service. That way it would be out of process app and
> running out of IIS context. One of the requirement is that the app
> should be running out of IIS host. and that is the reason i asked can
> we instantiate object on windows service from any application??

Can't comment on COM+ either because i dont't know enough about it (yes i
really began Windows programming with .NET...). However .NET Remoting seems
to be the ideal solution for you: you can host any object in your windows
service (no IIS involved although if you want you can also host your objects
in IIS) and access it from any .NET client app. You can expose you objects
as Client Activated Objects (CAO) in which case the objects are copied and
executed on the client side when a client invoke it (each client has its own
instance of the object) or you can expose them as Server Activated Objects
(SAO) in which case they remain on the server and their methods are executed
on the server side.

As i said to kiln, for more detailled info about .NET Remoting and web
service, i suggest you to have a look on the web (note that there are some
nice walkthrough on MSDN). I don;t have any good links at hands to offer
you.


kiln

7/21/2004 3:28:00 PM

0

Thanks, all of that is very a helpful window into this realm. All I
meant by noting that it seemed that two (or more as it turns out)
separate programs needed to be built was that the client end and the
server end are competely separate applications; they just know how to
talk to each other.

Thanks for writing up such a decent overview of the remoting dev process
for a newbie.


In article <u1m2bnxbEHA.3420@TK2MSFTNGP12.phx.gbl>,
rockfamily@REMOVEME.hotmail.com says...
> kiln wrote:
> > I'm also completely new to remoting...one thing I was wondering, with
> > remoting it would seem that there are two almost separate programs
> > involved, the client and the server.
>
> Well, the whole point of .NET Remoting is to make 2 or more applications
> communicate with each other. I guess that you can use remoting to make an
> application communicate with itself but i don't really the point of doing
> that. So yes, there are usually at least 2 seperate programs involved when
> you play with .NET Remoting.
>
> > app? I have vs.net but I'm just wondering about the mechanics of how
> > they are developed. Does vs.net provide a way to work with the client
> > end and the server end at the same time, or does one build out the
> > server end first and then the client interface?
>
> Building a .NET application is done in 3 steps. Imagine that you have a
> class BookingManager that contains a method MakeBooking() and that you want
> to host this class on a server application to allow any client application
> on the web or on your LAN to call the MakeBooking method. Here are the 3
> steps to be taken to do that:
>
> 1) Define the interface that describe your BokkingManager class so that both
> the client and server apps now what you are talking about
> 2) Implement this class in the server app and say that it can be accessed
> via .NET Remoting
> 3) Create a client app that connects to the server and call the MakeBooking
> method
>
> That's it. This means that you'll have to create 3 projects: one for the
> interface of your remote object (here the BookingManager class), one for the
> client application and one for the server application. How you manage those
> 3 projects is up to you. You can put them in 3 seperate solutions (in this
> case you'll have to have 3 instances of visual studio open at the same time
> if you want to work on the 3 projects at the same time) or you can put them
> all in the same solution in which case they will all appear in the same
> window of Visual Studio. You can implement the server app before the client
> app or the client app before the server app but in any case you'll need to
> first design the interface of your remote object.
>
> I'm not going to give you any sample code or detailled explanation because:
> 1) i'm not a very good teacher
> 2) there are already plenty of tutorials for beginners in .NET Remoting on
> the web (look at the code project web site for example)
>
> > I was wondering, is are there are any demo apps up on the web, that
> > allow guest users get the client app, log in, and enter junk data? I'd
> > be a kick to see it in action.
>
> This would be something trivial to do but i've never heard of anything like

Elp

7/21/2004 4:43:00 PM

0

kiln wrote:
> Thanks, all of that is very a helpful window into this realm. All I
> meant by noting that it seemed that two (or more as it turns out)

Yep, more than two applications can be involved. Actually, by default, when
you launch an application that exposes an object via .NET Remoting, any
application that has access to the remote interface (the remote interface is
usually placed in a DLL file distributed with the client application) can
connect to the server application and use the remote object. You have to be
careful about that: .NET Remoting has (almost) no built in security
features. It has however an extensible architecture, which allow you to
implement yourself security features. You can for example add filters that
would allow connections only from certain IP addresses, add an encryption
module.... You can also use third party libraries that work on top of .NET
Remoting and can do all that for you.

> the client end and the
> server end are competely separate applications; they just know how to
> talk to each other.

That's right.


kiln

7/22/2004 9:20:00 PM

0

Thanks, thanks!

One more puzzlement I'm running into with terminology; here, and
elsewhere, one runs into the phrases "no touch deployment" and "Internet
Deployment". Is that a synonym for remoting?

http://msdn.microsoft.com/library/default.asp?url=/l...
us/dnadvnet/html/vbnet10142001.asp

....is an older article that I'm reading; it seems to describe remoting,
as far as my understanding goes, but he's terming it "Internet
Deployment"; others have describe it as no touch (I've seen one touch
too). Are those passe terms for remoting?

In article <eR6Z#G0bEHA.1732@TK2MSFTNGP09.phx.gbl>,
rockfamily@REMOVEME.hotmail.com says...
> kiln wrote:
> > Thanks, all of that is very a helpful window into this realm. All I
> > meant by noting that it seemed that two (or more as it turns out)
>
> Yep, more than two applications can be involved. Actually, by default, when
> you launch an application that exposes an object via .NET Remoting, any
> application that has access to the remote interface (the remote interface is
> usually placed in a DLL file distributed with the client application) can
> connect to the server application and use the remote object. You have to be
> careful about that: .NET Remoting has (almost) no built in security
> features. It has however an extensible architecture, which allow you to
> implement yourself security features. You can for example add filters that
> would allow connections only from certain IP addresses, add an encryption
> module.... You can also use third party libraries that work on top of .NET
> Remoting and can do all that for you.
>
> > the client end and the
> > server end are competely separate applications; they just know how to
> > talk to each other.
>
> That's right.
>
>
>

Elp

7/23/2004 10:50:00 AM

0

kiln wrote:
> One more puzzlement I'm running into with terminology; here, and
> elsewhere, one runs into the phrases "no touch deployment" and
> "Internet Deployment". Is that a synonym for remoting?

As far as i know, no touch deployment has nothing to do with .NET Remoting.
I think, but i'm not very knowledgable about that, that this is a new
deployment technique that allow you to place a windows application on a web
site: when the user clicks on a link, the windows application is
automatically downloaded from the web site and executes. You therefore can
develop applications with a rich user interface that can be used as easily
as browsing to a web page, without the need to install anything (except the
..NET Framework of course).

Try this newsgroup for more info: microsoft.public.dotnet.framework.setup


kiln

7/24/2004 1:23:00 AM

0

In article <O3J6aLKcEHA.2660@TK2MSFTNGP12.phx.gbl>,
rockfamily@REMOVEME.hotmail.com says...
> kiln wrote:
> > One more puzzlement I'm running into with terminology; here, and
> > elsewhere, one runs into the phrases "no touch deployment" and
> > "Internet Deployment". Is that a synonym for remoting?
>
> As far as i know, no touch deployment has nothing to do with .NET Remoting.
> I think, but i'm not very knowledgable about that, that this is a new
> deployment technique that allow you to place a windows application on a web
> site: when the user clicks on a link, the windows application is
> automatically downloaded from the web site and executes. You therefore can
> develop applications with a rich user interface that can be used as easily
> as browsing to a web page, without the need to install anything (except the
> .NET Framework of course).
>
> Try this newsgroup for more info: microsoft.public.dotnet.framework.setup
>
Thanks; but the article I was pointing to was from 2001, so it's not
something really new. I'll check around more on this subject.

Sunny

7/24/2004 3:16:00 AM

0

Hi,
at the very beginning MS used to name Notouch deployment also some kind of
remoting. Then, because it was too confusing with the the remoting
technology, they started to use Nontouch deployment for the applications
which you download from a server and run locally.

Sunny

kiln wrote:

> In article <O3J6aLKcEHA.2660@TK2MSFTNGP12.phx.gbl>,
> rockfamily@REMOVEME.hotmail.com says...
>> kiln wrote:
>> > One more puzzlement I'm running into with terminology; here, and
>> > elsewhere, one runs into the phrases "no touch deployment" and
>> > "Internet Deployment". Is that a synonym for remoting?
>>
>> As far as i know, no touch deployment has nothing to do with .NET
>> Remoting. I think, but i'm not very knowledgable about that, that this is
>> a new deployment technique that allow you to place a windows application
>> on a web site: when the user clicks on a link, the windows application is
>> automatically downloaded from the web site and executes. You therefore
>> can develop applications with a rich user interface that can be used as
>> easily as browsing to a web page, without the need to install anything
>> (except the .NET Framework of course).
>>
>> Try this newsgroup for more info: microsoft.public.dotnet.framework.setup
>>
> Thanks; but the article I was pointing to was from 2001, so it's not
> something really new. I'll check around more on this subject.