Skip to content

Console application run as a windows service or command line in C# 2.0

Sundarapandian Balasubramanian

Asked Sep 4, 2007, 12:43 AM EDT1 answer
Share
LinkedInX

Hi all,

 

Right we have application using Microsoft Visual C# 2.0.

 

Application divided by two programs

         

1.      Win forms          

2.      Console Application.

 

We already completed that program using C# 2.0.

 

Console application, I like to run as a windows service or command line. (It’s depends on the user option).

 

How can I run a console application as command line or windows service?

[I don’t want separate EXE for console or windows service, I need to run one EXE as a Console or Windows Service).

 

How can I implement this functionality?

 

Kindly let me know the technical idea or sample code for that.

 

Thank you,

 

Sundar.

1 Answer

Know the answer? Post it. Somebody with the same question will find it here.

  • 0
    it is a bit hard i think because windows serviece's exe cannot be run directly by clicking. u need do sth like registering windows service's exe. however in console app, if u click the exe it will run.  i mean this is abit confusing to me but, it is good to learn if  it is possible
    0