Solved

How to run application as windows service

Posted on 2008-10-20
5
2,054 Views
Last Modified: 2012-05-05
Would like the user to be able to select an option on our VB.NET windows application which then installs and starts it as a windows service. If the user run the application again it informs it is running as service and gives the option to stop the service. Any ideas how to do this ?
0
Comment
Question by:cehrnow
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 41

Expert Comment

by:graye
ID: 22758458
In the "old days"... there really wasn't much difference between a ordinary application and a Windows Service.   There was even a set of tools that allowed you to convert an console app into a service.   So, to have a single application that performed both functions was an option (although a poor option).  However, that's not really practical now days.
I'd recommend that you write two applications... one that is a "pure" service and one that is a "pure" Windows Form application.   You have many choices on how to have the two pieces talk to each other.
Let us know if  you need help in writing this pair of applications
0
 

Author Comment

by:cehrnow
ID: 22758500
Would mean having two sets of code to maintain. I've seen some applications that do enable you to do this but not sure how they achieve it.
0
 
LVL 41

Accepted Solution

by:
graye earned 500 total points
ID: 22758531
Yes, that's correct...   one application would be a "pure" service with no user interface at all... and the other application would have the user interface, but no "guts"
0
 

Author Comment

by:cehrnow
ID: 22758557
Oh I see what you mean..might not be practical but I'll take a look. Thanks
0
 
LVL 23

Expert Comment

by:Tony McCreath
ID: 22765583
You could have a third library project (dll) that has the logic in it and use this common library in a simple service project and a simple application project.

Then you can share the code
0

Featured Post

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

IP addresses can be stored in a database in any of several ways.  These ways may vary based on the volume of the data.  I was dealing with quite a large amount of data for user authentication purpose, and needed a way to minimize the storage.   …
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

626 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question