I'd like to write a windows service in .net, in itself that's not a big deal,
but my problem comes from the fact that I'd quite like to have the ability to
have a console attached to the service. The reasoning behind it is that Iâ??d
like to have the option of some user input, but if they do something stupid
(namely shutdown the service) it will restart itself and continue, plus it
would be useful to have some screen logging, just the sort of stuff that is
more than I want in the event log (start stop, error) but not the sort of
level of detail that will be in the file logs, which is too much for the
average service engineer to trawl through.

I thought I read somewhere that there was a property along the lines of
HasConsole, but I canâ??t find it, it what Iâ??m trying possible of do I need to
write a trace listener to listen for information from the service?

Thanks for any help.
Rob

Re: Windows service with console by Lloyd

Lloyd
Wed May 11 18:42:23 CDT 2005

don't make sense......
service start at system startup, when no one is even logged.
having a console on the screen at this time when no user is logged would be
a security issue, wouldn't it?

on the other hand you could write your own code where the service listen to
a socket or rmi or shared memory or pipe or MSMQ or whatever.....

"Rob White" <Rob White@discussions.microsoft.com> wrote in message
news:B558EB9C-1AFE-42FB-92B9-EB0B33AAD89D@microsoft.com...
> I'd like to write a windows service in .net, in itself that's not a big
> deal,
> but my problem comes from the fact that I'd quite like to have the ability
> to
> have a console attached to the service. The reasoning behind it is that I'd
> like to have the option of some user input, but if they do something
> stupid
> (namely shutdown the service) it will restart itself and continue, plus it
> would be useful to have some screen logging, just the sort of stuff that
> is
> more than I want in the event log (start stop, error) but not the sort of
> level of detail that will be in the file logs, which is too much for the
> average service engineer to trawl through.
>
> I thought I read somewhere that there was a property along the lines of
> HasConsole, but I can't find it, it what I'm trying possible of do I need
> to
> write a trace listener to listen for information from the service?
>
> Thanks for any help.
> Rob



Re: Windows service with console by RobWhite

RobWhite
Thu May 12 03:27:01 CDT 2005

It could be a security issue, but wouldn't be in this instance, basically we
need all the features of a windows service, (auto start, retstart etc), but
we need to be able to have some sort of console output, ideally that would be
with a console.

I've found the switch in the install utility "/LogToConsole={true|false}",
i'm just a little unsure of how to actually use it.

"Lloyd Dupont" wrote:

> don't make sense......
> service start at system startup, when no one is even logged.
> having a console on the screen at this time when no user is logged would be
> a security issue, wouldn't it?
>
> on the other hand you could write your own code where the service listen to
> a socket or rmi or shared memory or pipe or MSMQ or whatever.....
>
> "Rob White" <Rob White@discussions.microsoft.com> wrote in message
> news:B558EB9C-1AFE-42FB-92B9-EB0B33AAD89D@microsoft.com...
> > I'd like to write a windows service in .net, in itself that's not a big
> > deal,
> > but my problem comes from the fact that I'd quite like to have the ability
> > to
> > have a console attached to the service. The reasoning behind it is that I'd
> > like to have the option of some user input, but if they do something
> > stupid
> > (namely shutdown the service) it will restart itself and continue, plus it
> > would be useful to have some screen logging, just the sort of stuff that
> > is
> > more than I want in the event log (start stop, error) but not the sort of
> > level of detail that will be in the file logs, which is too much for the
> > average service engineer to trawl through.
> >
> > I thought I read somewhere that there was a property along the lines of
> > HasConsole, but I can't find it, it what I'm trying possible of do I need
> > to
> > write a trace listener to listen for information from the service?
> >
> > Thanks for any help.
> > Rob
>
>
>

Re: Windows service with console by dan

dan
Thu May 12 03:55:50 CDT 2005

Hi

Yes I have done that with a tray icon....

There is a setting "Allow service to interact with desktop" in the
service properties.

But you can do it in code with

InParam["DesktopInteract"] = true;

in the ProjectInstaller.cs

Regards,

Daniel Roth
MCSD.NEt




Rob White wrote:
> It could be a security issue, but wouldn't be in this instance,
basically we
> need all the features of a windows service, (auto start, retstart
etc), but
> we need to be able to have some sort of console output, ideally that
would be
> with a console.
>
> I've found the switch in the install utility
"/LogToConsole={true|false}",
> i'm just a little unsure of how to actually use it.
>
> "Lloyd Dupont" wrote:
>
> > don't make sense......
> > service start at system startup, when no one is even logged.
> > having a console on the screen at this time when no user is logged
would be
> > a security issue, wouldn't it?
> >
> > on the other hand you could write your own code where the service
listen to
> > a socket or rmi or shared memory or pipe or MSMQ or whatever.....
> >
> > "Rob White" <Rob White@discussions.microsoft.com> wrote in message
> > news:B558EB9C-1AFE-42FB-92B9-EB0B33AAD89D@microsoft.com...
> > > I'd like to write a windows service in .net, in itself that's not
a big
> > > deal,
> > > but my problem comes from the fact that I'd quite like to have
the ability
> > > to
> > > have a console attached to the service. The reasoning behind it
is that I'd
> > > like to have the option of some user input, but if they do
something
> > > stupid
> > > (namely shutdown the service) it will restart itself and
continue, plus it
> > > would be useful to have some screen logging, just the sort of
stuff that
> > > is
> > > more than I want in the event log (start stop, error) but not the
sort of
> > > level of detail that will be in the file logs, which is too much
for the
> > > average service engineer to trawl through.
> > >
> > > I thought I read somewhere that there was a property along the
lines of
> > > HasConsole, but I can't find it, it what I'm trying possible of
do I need
> > > to
> > > write a trace listener to listen for information from the
service?
> > >
> > > Thanks for any help.
> > > Rob
> >
> >
> >