Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Win-UI] : Not able to add the background tasks Windows.ApplicationModel.Background.IBackgroundTask #4200

Closed
MoueenShaik opened this issue Feb 16, 2021 · 3 comments
Labels
product-winui3 WinUI 3 issues

Comments

@MoueenShaik
Copy link

MoueenShaik commented Feb 16, 2021

Describe the bug
I am trying to add BackgroundTasks which is a type of Windows.ApplicationModel.Background.IBackgroundTask as per the below Microsoft doc in WINUI
https://docs.microsoft.com/en-us/windows/uwp/launch-resume/create-and-register-a-background-task

To achieve my requirement, added the background tasks under the declaration tab in the Package.appmanifest.

image
image

After adding the background tasks and tried to build the solution but unfortunately, I am getting the below exception.
image
To fix the above issue one of the technical forum suggested that adding an audio task will get resolved.
Adding an audio task to the package.manifest file, build issue got resolved, But when I launch the application getting the below exception

image

FYI :
Visual Studio version: Visual Studio Enterprise 2019 Preview - 16.7.30128.36
.Net SDK : Microsoft .NET SDK 5.0.100-preview.5.20279.10(x86)
WinUIVersion : 3.0.0-preview2.200713.0
csproject:
image

Steps to reproduce the bug

Steps to reproduce the behavior:

  1. Create a new Blank app packaged,(WINUI in Desktop)
  2. Add a new class with inherit from IBackgroundTask
  3. Add background-tasks to the package.Manifest under declaration tab.
  4. Build the solution.

Expected behavior
Application should build/run

Version Info

NuGet package version:
[Microsoft.WinUI 3.0.0-preview2.200713.0]

Windows app type:

UWP Win32
Windows 10 version Saw the problem?
Insider Build (xxxxx)
October 2020 Update (19042)
May 2020 Update (19041)
November 2019 Update (18363)
May 2019 Update (18362)
October 2018 Update (17763)
April 2018 Update (17134)
Fall Creators Update (16299)
Creators Update (15063)
Device form factor Saw the problem?
Desktop
Xbox
Surface Hub
IoT

Could you please guide/help me on how to add background tasks in winUI desktop application without exceptions? and let me know if you need any other details from my end.

Thanks & regards,
Moueen Shaik

@ghost ghost added the needs-triage Issue needs to be triaged by the area owners label Feb 16, 2021
@StephenLPeters StephenLPeters added version-winui3preview4 WinUI 3 Preview 4 issues product-winui3 WinUI 3 issues labels Feb 17, 2021
@StephenLPeters
Copy link
Contributor

Can you please first try upating your Winui3 version from Preview 2 to Preview 4?

@StephenLPeters StephenLPeters added needs-author-feedback Asked author to supply more information. and removed needs-triage Issue needs to be triaged by the area owners version-winui3preview4 WinUI 3 Preview 4 issues labels Feb 17, 2021
@ghost ghost added the no-recent-activity label Feb 24, 2021
@ghost
Copy link

ghost commented Feb 24, 2021

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 7 days. It will be closed if no further activity occurs within 7 days of this comment.

@ghost ghost closed this as completed Mar 3, 2021
@ghost ghost added needs-triage Issue needs to be triaged by the area owners and removed no-recent-activity labels Dec 1, 2021
@shahidjaved
Copy link

You can try adding another extentisions tag in Package manifest file. like below image it is working for me.
image

@StephenLPeters StephenLPeters removed needs-author-feedback Asked author to supply more information. needs-triage Issue needs to be triaged by the area owners labels Feb 10, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
product-winui3 WinUI 3 issues
Projects
None yet
Development

No branches or pull requests

3 participants