SOLVED

MSIX for UWP and Windows service Bundle

%3CLINGO-SUB%20id%3D%22lingo-sub-1209096%22%20slang%3D%22en-US%22%3EMSIX%20for%20UWP%20and%20Windows%20service%20Bundle%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1209096%22%20slang%3D%22en-US%22%3E%3CP%3EI%20have%20read%20in%20some%20threads%20that%20MSIX%20will%20start%20to%20support%20also%20windows%20services%20from%20the%20January%20build.%20But%20I%20only%20seem%20to%20find%20information%20of%20how%20to%20migrate%20an%20existing%20installer%20containing%20a%20service%20to%20MSIX.%20How%20should%20I%20do%20if%20I%20want%20to%20create%20a%20completely%20new%20MSIX%20bundle%20from%20scratch%2C%20containing%20a%20UWP%20project%20and%20a%20Windows%20Service%3F%3C%2FP%3E%3CP%3EI%20have%20a%20sollution%20in%20visual%20studio%20containing%26nbsp%3B%20a%20UWP%20project%20and%20a%20Windows%20Service%20Project.%20I%20try%20to%20simply%20add%20those%20two%20projects%20to%20a%20new%20windows%20application%20packaging%20project%20but%20no%20matter%20how%20I%20do%20this%20I%20only%20manage%20to%20install%20the%20UWP%20app%20from%20the%20created%20bundle.%20Is%20it%20still%20not%20possible%20to%20include%20the%20Service%20project%20in%20my%20MSIX%3F%20I%20can%C2%B4t%20find%20no%20documentation%20of%20how%20this%20could%20be%20done.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20also%20found%20this%20thread%20suggesting%20to%20use%20background%20tasks%20instead%20of%20a%20Service%3A%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fsocial.msdn.microsoft.com%2FForums%2Fen-US%2F8d9c8a03-0f56-4a22-9b42-516c047e71d9%2Fmsix-packaging%3Fforum%3Dwpdevelop%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fsocial.msdn.microsoft.com%2FForums%2Fen-US%2F8d9c8a03-0f56-4a22-9b42-516c047e71d9%2Fmsix-packaging%3Fforum%3Dwpdevelop%3C%2FA%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIs%20this%20still%20the%20recommendation%3F%20I%20am%20afraid%20that%20the%20background%20task%20may%20be%20a%20bit%20too%20limitied%20for%20my%20intentions.%20My%20main%20requirement%20for%20a%20service%20is%20not%20to%20have%20something%20running%20in%20the%20background%2C%20but%20to%20access%20functions%20outside%20the%20UWP%20sandbox.%20Like%20USB%20storage%20and%20other%20functionality.%20But%20maybe%20this%20can%20be%20achieved%20by%20a%20background%20task%20as%20well%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESo%20my%20question%20is%20if%20I%20should%20go%20for%20the%20MSIX%20sollution%20or%20if%20I%20need%20to%20relay%20on%20some%20other%20packaging%20sollution%20for%20my%20projects.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1211383%22%20slang%3D%22en-US%22%3ERe%3A%20MSIX%20for%20UWP%20and%20Windows%20service%20Bundle%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1211383%22%20slang%3D%22en-US%22%3E%3CP%3EJust%20linking%20to%20the%20same%20question%20on%20StackOverflow%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fstackoverflow.com%2Fquestions%2F60529718%2Fcreate-a-msix-bundle-containing-a-uwp-app-and-a-windows-service%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fstackoverflow.com%2Fquestions%2F60529718%2Fcreate-a-msix-bundle-containing-a-uwp-app-and-a-windows-service%3C%2FA%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1212646%22%20slang%3D%22en-US%22%3ERe%3A%20MSIX%20for%20UWP%20and%20Windows%20service%20Bundle%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1212646%22%20slang%3D%22en-US%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F574275%22%20target%3D%22_blank%22%3E%40ABerglund%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EOur%20recommendation%20for%20apps%20in%20development%20is%20to%20use%20background%20tasks%20instead%20of%20trying%20to%20add%20a%20Windows%20Service.%26nbsp%3B%3C%2FP%3E%0A%3CP%3EFor%20the%20case%20where%20you're%20trying%20to%20access%20content%20outside%20the%20UWP%20container%2C%20you%20can%20consider%20adding%20a%20desktop%20extension%20component%20to%20your%20UWP%20package%20and%20then%20using%20that%20for%20your%20required%20functionality.%20Have%20a%20look%20at%20this%20blog%20post%20for%20more%20details%20-%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fstefanwick.com%2F2018%2F04%2F06%2Fuwp-with-desktop-extension-part-1%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fstefanwick.com%2F2018%2F04%2F06%2Fuwp-with-desktop-extension-part-1%2F%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ECheers%2C%3C%2FP%3E%0A%3CP%3ETanaka%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
Visitor

I have read in some threads that MSIX will start to support also windows services from the January build. But I only seem to find information of how to migrate an existing installer containing a service to MSIX. How should I do if I want to create a completely new MSIX bundle from scratch, containing a UWP project and a Windows Service?

I have a sollution in visual studio containing  a UWP project and a Windows Service Project. I try to simply add those two projects to a new windows application packaging project but no matter how I do this I only manage to install the UWP app from the created bundle. Is it still not possible to include the Service project in my MSIX? I can´t find no documentation of how this could be done.

 

I also found this thread suggesting to use background tasks instead of a Service:

https://social.msdn.microsoft.com/Forums/en-US/8d9c8a03-0f56-4a22-9b42-516c047e71d9/msix-packaging?f...

 

Is this still the recommendation? I am afraid that the background task may be a bit too limitied for my intentions. My main requirement for a service is not to have something running in the background, but to access functions outside the UWP sandbox. Like USB storage and other functionality. But maybe this can be achieved by a background task as well?

 

So my question is if I should go for the MSIX sollution or if I need to relay on some other packaging sollution for my projects.

 

2 Replies
Highlighted
Highlighted
Best Response confirmed by ABerglund (Visitor)
Solution

Hi @ABerglund 

 

Our recommendation for apps in development is to use background tasks instead of trying to add a Windows Service. 

For the case where you're trying to access content outside the UWP container, you can consider adding a desktop extension component to your UWP package and then using that for your required functionality. Have a look at this blog post for more details - https://stefanwick.com/2018/04/06/uwp-with-desktop-extension-part-1/

 

Cheers,

Tanaka