views:

144

answers:

2

I would like to create a windows service in .NET that runs on WinMo 6.x.... There r a lot of documentation for how to do that in MFC (and non-MFC) http://msdn.microsoft.com/en-us/library/ms838599.aspx

but I can't find any pointers for .NET stuff, is it even doable?

Thanks,

+2  A: 

I'm pretty sure (not 100%) you can only create a native service DLL (which means no .Net for this).

A workaround is to create a console app (or a regular app that does everything from its Main method) and drop it in the /Windows/Startup/ folder. Your app will then be started automatically every time the device is reset. There are good reasons not to do this, however, since a WinMo device is limited in how many apps can be running like this.

MusiGenesis
A: 

There is no built in support for managed services on the .NET CF (much like other parts of the OS such as today screen panels or software input panels aka keyboards don't support managed code).

As MusiGenesis suggested a good workaround is to simply place a GUI less executable within the startup folder as services on Windows Mobile usually don't have the need for a services manager type application to list available services and their current status etc.

If you're wanting something a little more structured or need some kind of GUI to start/stop your services you could look into the following codeplex project: Managed Services for Windows Mobile - http://www.codeplex.com/managedserviceswm. However it is essentially just adding some additional abstractions around placing something in \windows\startup\ so may not be worth it...

Christopher Fairbairn