Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / May 2005

Tip: Looking for answers? Try searching our database.

Windows service with console

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Rob White - 11 May 2005 15:56 GMT
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
Lloyd Dupont - 12 May 2005 00:42 GMT
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.....

> I'd like to write a windows service in .net, in itself that's not a big
> deal,
[quoted text clipped - 17 lines]
> Thanks for any help.
> Rob
Rob White - 12 May 2005 09:27 GMT
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.

> don't make sense......
> service start at system startup, when no one is even logged.
[quoted text clipped - 25 lines]
> > Thanks for any help.
> > Rob
dan.c.roth@gmail.com - 12 May 2005 09:55 GMT
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

> 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
[quoted text clipped - 33 lines]
> > > Thanks for any help.
> > > Rob

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.