Reputation:
I need to write a windows service which executes an application after a certain amount of time. I have checked out the code in MSDN and found an example in which the System.ServiceProcess.ServiceBase class is sub-classed.
I did the following.
I get the following error
The type or namespace name 'ServiceProcess' does not exist in the namespace 'System'(are you missing an assembly reference?)
As i had copied the example from MSDN, i have no idea why the code still does not work. This is my first experience writing services and i`d love some guidance.
thnkx!
Upvotes: 2
Views: 1469
Reputation: 5998
You also know that services used for just scheduling tasks is pretty expensive?
Microsoft always recommends the scheduler for this kind of stuff. Maybe you have good reasons to do this like this, but I just wanted to say this ;)
Upvotes: 6
Reputation: 7986
Did you include a reference to the System.ServiceProcess namespace in your project? Right-click on your project in Solution Explorer and select 'Add Reference' and then find System.ServiceProcess in the list on the .NET tab.
Upvotes: 10
Reputation: 62027
You need to add a reference to System.ServiceProcess.dll
in your app. If you go to MSDN, you will see it tells you what assembly and physical dll the class you are looking at is found in.
Upvotes: 10