Describe the bug
When I use the last SDK of Windows 10 (17763) to compile my application, I have an error with the background tasks that are using XamlRenderingBackgroundTask. Background tasks that are using IBackgroundTask work fine.
When the execution starts, the BackgroundTaskHost.exe process crash with this stacktrace (from the Windows Store):
stackTrace - backgroundtask issue 17763.txt
This issue is also visible in the statistics of a flight build (Preview) of my app in the Windows Store.
You can see the issue appears only on builds 17763 and beyond.
On the previous builds of Windows 10, the same version of the app work well (for example on my Lumia).
Steps to reproduce the bug
This is a simple project to reproduce the issue:
I have implemented two background tasks:
If I put a breakpoint in the tasks and start the execution of the tasks, the BackgroundTask1 is working but the BackgroundTask2 throw an exception:
Expected behavior
All background tasks (IBackgroundTask and XamlRenderingBackgroundTask) needs to be work on builds 17763+ when the application use the SDK 17763.
Actually, if I use the SDK 17763 - my application is not working on the builds 17763+.
If I use the previous SDK, my app is working on the previous and builds 17763+.
Seems a regression of the 17763 SDK, or a Windows 10 bug or a undocumented change.
Version Info
The issue occurs on stable build 17763.XXX and 19H1 Preview builds of Windows 10.
The issue is not encounter on previous version of Windows 10.
NuGet package version: not applicable in this case.
Windows 10 version:
Device form factor:
Thanks,
Christophe
Thanks for reporting this. Can you please also include the MyBackgroundTasks sub-project which contains your background task code? The zip only has the main solution which doesn't include this code, so I can't actually build your sample.
Thanks!
Thanks for the update. I build the sample and have reproduced the issue. We're investigating... At this point I don't see any work-around but we don't have a root cause yet. Will update when we know more.
Thanks for the report. Now tracked as an internal issue.
Thanks for the status.
I reported this issue over 2 1/2 months ago and they closed it and told me to report it in the Windows Insider hub. It has been over 2 months since I reported it there.. still no one has acknowledged that this is an issue, but yet they continue to force new bug ridden versions of Windows on us while breaking APIs that are necessary for us to write software to support this buggy OS!!!! NICE JOB MS!!!!!!!
@Stedy59 Can you share a link to where you reported the issue? I will follow-up to understand why the issue was apparently closed instead of being forwarded to the dev team.
@jevansaks, @kmelmon Have you new information to share with us about analysis of this bug?
We have made some progress but don't have a root cause or a fix yet. The bug has been routed to the appropriate area experts who should be back from vacation this week.
Thanks for the info and your help :-)
Here is the first post from October 17th, 2018…
After not agreeing with the response, I decided that I needed to re-submit it, so here is the second posting from November 6th, 2018…
Thank you for looking into this because I have to applications in the store that use these APIs…
Regards,
Edward J. Boelzner, Principal Software Architect
From: kmelmon notifications@github.com
Sent: Monday, December 31, 2018 3:40 PM
To: Microsoft/microsoft-ui-xaml microsoft-ui-xaml@noreply.github.com
Cc: Edward J. Boelzner edward.boelzner@stedysoft.com; Mention mention@noreply.github.com
Subject: Re: [Microsoft/microsoft-ui-xaml] SDK 17763: Issue with XamlRenderingBackgroundTask on builds 17763+ (#99)
@Stedy59https://github.com/Stedy59 Can you share a link to where you reported the issue? I will follow-up to understand why the issue was apparently closed instead of being forwarded to the dev team.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHubhttps://github.com/Microsoft/microsoft-ui-xaml/issues/99#issuecomment-450688663, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AsJHQOMPofTJTgV_RxVeXu6G_76Jmdw1ks5u-nY2gaJpZM4ZVkDY.
Update: We're still working on finding a root cause. In the mean-time, I wanted to suggest a potential work-around. From playing around with background rendering tasks, it looks like you need to create a separate project for the background task. If this project targets an SDK version < 17763 the crash is avoided. The main app project should be able to continue to target the latest SDK.
The limitation here would be that the background rendering project cannot access RS5+ features. The hope is that this code doesn't actually need RS5+ features, since all it needs to do is produce a live tile. Is that an acceptable workaround for you guys?
Thanks for the update @kmelmon
I have done some tests with the workaround but it's not working for me. My tasks are in one project and this project uses some other class librairies to share some logics between tasks and the application. I have attempt to use the last SDK in all projects except the "Task" project without success. I have made a second attempt to use the last SDK only on the application project without success too.
At this point, the workaround is not working for me (or not in all cases).
Thank you for the proposed workaround(s)… Here are my findings:
1) The only background task(s) that are failing are ones that implement "XamlRenderingBackgroundTask"
- These are already separate projects as they are "Windows Runtime Components"
2) Setting the target SDK to < 17763 in the background task projects fails as before.
- Leaving the target SDK @ 17763 in the background task project but setting the target SDK to < 17763 in the main project that registers and calls it... works!
3) This would indicate to me that the bug is in the attempt to register the "XamlRenderingBackgroundTask" task, as opposed to the actual implementation being executed.
Leaving the target SDK @ < 17763 at this point is not an issue because the API pertaining to XAML did not change much... but, in the future, moving to the "19H1" branch of Windows, the XAML / .NET Core landscape has a massive change. "XAML islands", etc...
Update: The issue has been fixed for the next public release of XAML (codename 19H1).
Thank you so much for your help and your follow. Appreciated!
Does this mean the XamlRenderingBackgroundTask will inevitably crash on 17763 or is there any workaround?