Link to home
Get AccessLog in
Avatar of Susurrus
Susurrus

asked on

How to convert my Console App to a Windows Service

I am learning about Windows Services, and as an example I decided to try converting one of my apps to a windows service.  I created a windows service and then added all my apps cs files and refrences.  Where before I started my first class from inside the of the "static void Main", I tried to add it to "On Start" but I get an error message:

The type or namespace name 'DwnTmr' could not be found (are you missing a using directive or an assembly reference?) (CS0246) - C:\TestProjects\Mdate\Mdate.cs:46,8

(I have encluded the OnStart code to show how I am calling my class)
protected override void OnStart(string[] args)
{
     DwnTmr dtmr = new DwnTmr();
}

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Romi Kuntsman
Romi Kuntsman
Flag of Israel image

Link to home
membership
This content is only available to members.
To access this content, you must be a member of Experts Exchange.
Get Access
SOLUTION
Link to home
membership
This content is only available to members.
To access this content, you must be a member of Experts Exchange.
Get Access
Avatar of Susurrus
Susurrus

ASKER

Yes, you guys are both right, I forgot to change the namespace  :)  I panicked when it didn't work and thought it must me something to do with the way windows services works!  Oh well, thanks for the help