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

痴心易碎 提交于 2019-12-04 04:42:50

问题


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,


回答1:


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.




回答2:


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



来源:https://stackoverflow.com/questions/1563674/create-a-net-windows-service-on-windows-mobile-6-x

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!