Since WinRT have unique capabilities, I wonder if it were to make a Windows Service that is targeted to WinRT? If it were not possible, is the workaround to make an invisible WinRT/Metro application possible?
Thanks a lot.
Since WinRT have unique capabilities, I wonder if it were to make a Windows Service that is targeted to WinRT? If it were not possible, is the workaround to make an invisible WinRT/Metro application possible?
Thanks a lot.
It depends on what you want to do.
WinRT is an API and can be accessed from Metro (Windows Store) Apps and from Desktop/C# apps.
However not the full API is exposed - see what you are allowed to access here: http://msdn.microsoft.com/en-us/library/windows/desktop/hh920511%28v=vs.85%29.aspx
Hanselman shows how to add a ref to WinRT:
http://www.hanselman.com/blog/HowToCallWinRTAPIsInWindows8FromCDesktopApplicationsWinRTDiagram.aspx
Nope this isn't possible (wither the service, or the "invisible" metro application).
You can run background tasks that may do what you are after, but without understanding your problem I couldn't say.
No is the correct answer. A metro application executes inside the Metro shell and inside an execution container that creates a sandbox away from system resources, including services. For this reason a metro app cannot access a local service. Similarly, for this reason, a metro app cannot be a service.
Background tasks and push notifications through Windows Notification Services are the only way for a metro app to interact with the user while not active. Otherwise, when the application is not active (not visible), all of its threads are suspended (unlike a service).
As for background tasks, their activity is constrained identically to a metro app and limited to a single CPU second every 2 hours (there is one exception). Push notifications can execute more frequently, but are only capable of updating a tile or raising a toast notification.
The intent of a metro application is different than a traditional desktop application:
Look, choosing a metro application does mean to concede some of the unlimited power of desktop applications. However, the gains are significant, too.