"David" <da*********@yoowhoo.comwrote in message
news:3d******************************@comcast.com. ..
>No luck yet. I created a service from scratch but keep getting the "service
"Steve Gerrard" <my********@comcast.netwrote in message
news:VZ******************************@comcast.com. ..>David wrote:>>Hi,...
I am trying to change an application to a service and am having a few
problems. Here are the steps I've been performing:
- Exclude all forms from project and delete all associated files.
- Disable use framework (.net application?) in project properties
- Switch application type to Service
- Add a service class to the project
- Add an installer to the service class and configure properties of
components for localservice and automatic startup
- Add a setup project
- Add primary output to setup project
- Set all custom actions to primary output
At this point I receive an error stating that there is no Main
subroutine. I did not have this problem last time I switched an
application to a service, years ago.
>>>
How should this program begin running? Through Main() or the
service's OnStart event? Do I need to use both? Can I use both?
I would suggest you start a new project, make it a windows service, and
go from there. I believe the service class has a designer file with it,
and a fairly convoluted bit of code dealing with starting the service. I
would not want to recreate that from scratch. Once you get that template
in place, from your point of view, an instance of your service class is
created for you, and you first get control in the OnStart event.
If you start it that way, you should be able to copy and paste, or copy
files over, to build up the rest of your application in the service.
Thanks Steve,
I'll give that a try.
david
on local computer started and then stopped," error. I commented almost all
of the code in my OnStart subroutine yet the error persists. Any ideas why
this might be?