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

后端 未结 2 1666
长情又很酷
长情又很酷 2021-01-20 15:45

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/

相关标签:
2条回答
  • 2021-01-20 16:31

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

    0 讨论(0)
  • 2021-01-20 16:41

    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.

    0 讨论(0)
提交回复
热议问题