How to convert a windows app to windows service?
I have an application written in vb.net 2008, and I want to convert this to a windows service. It does have an interface, but only to start/stop the application timer, and display a log. What are the steps to convert this into a windows service? :confused:
Re: How to convert a windows app to windows service?
Are you using the express edition of 2008 or do you have a version you paid for? I know that professional and above come with a template to create a service. You can use that template as a base, to understand how a service is created. Once you do that, you can take the code that is created and integrate it into your app. If I recall correctly, it is just a special interface that gets implemented and then you use installutil to install the service.
1 Attachment(s)
Re: How to convert a windows app to windows service?
Attachment 76496
How to solve this?
Re: How to convert a windows app to windows service?
Quote:
Originally Posted by
Tommy.net
As the error message suggests, you cannot run a service in the debugger. You have to install it, run it and then attach a debugger to it.
http://www.google.com.au/search?q=de...ient=firefox-a
Re: How to convert a windows app to windows service?
As a note, one of the guys I used to work with found a creative way to deal with this issue of debugging services. He created a Console Application project, modified it to run as a service and then he was able to debug it as a console app in VS but then install it to run as a service in production. I'm not exactly sure how he did it and whether there were any issues but I really should look into that. I've never had to create a service myself so I've never bothered before.
Re: How to convert a windows app to windows service?
I like to use the Debugger.Launch method in my code, which will prompt you to select a debugger to use for the code.
Re: How to convert a windows app to windows service?
Quote:
Originally Posted by
Negative0
Are you using the express edition of 2008 or do you have a version you paid for? I know that professional and above come with a template to create a service. You can use that template as a base, to understand how a service is created. Once you do that, you can take the code that is created and integrate it into your app. If I recall correctly, it is just a special interface that gets implemented and then you use installutil to install the service.
I have VS 2008 Professional.
Re: How to convert a windows app to windows service?
Then you have a service template. Create a new service project and then see how the code works. As I stated, it is not that complex, so you should be able to take that and get going. Basically, your OnStart method is your main entry point to the application.