- Home /
UWP IL2CPP and Windows Background Task not work
I need to use background tasks to write plugin and a can't find better way to support background tasks feature for UWP IL2CPP without additional actions.
What's problem? If i understand correctly, IL2CPP compiler build all managed assemblies to cpp code, IL2CPP compiler also build my out of process .winmd library to cpp code too.
It's a problem because as i understand, background tasks code must be in separate library, according to this documentation:
https://docs.microsoft.com/en-us/windows/uwp/launch-resume/create-and-register-a-background-task
So, i tried to add reference to my winmd library with background tasks in VS project and it work. My .winmd library copy to target project folder when i build VS project and background tasks work fine. Without adding reference to winmd library it not work of course.
So i would like to know how i can prevent my .winmd library (windows runtime component) from building via il2cpp compiler to cpp code. And how can I make the resulting Visual Studio project automatically have a link to my * .winmd library. In this case, it will be copied automatically to the target catalogue of an app and my background tasks will work.
Thanks for any help.
Exactly the same issue here. Considering Unity 2019.1.0f2 (and, I suppose, any future versions) provide IL2CPP as the only scripting backend option, WNS push notifications when the app is not running gets impossible without those manual actions, as described above. Critical problem for WNS-assets developers!
Update: I implemented patching of .vcxproj file to add required references as a post-build editor script. Ugly, but works.
Your answer
Follow this Question
Related Questions
Does LibSpotify SDK crashes Unity3D? 2 Answers
Linux server .so files not loaded 0 Answers
Unable to make iOS build on Windows 10 machine 0 Answers
Any updates on how to debug multitouch in Unity on a Windows PC with touchscreen? 0 Answers
Unity build is different every time I play it, despite it being the exact same file? 0 Answers