简体   繁体   中英

Create a .NET Windows Service on Windows Mobile 6.x

I would like to create a windows service in .NET that runs on WinMo 6.x.... There ra 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,

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.

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...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM