Skip to content

Fix UniversalBGTask DLL inclusion in unpackaged app output#2

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/fix-1
Draft

Fix UniversalBGTask DLL inclusion in unpackaged app output#2
Copilot wants to merge 2 commits intomainfrom
copilot/fix-1

Conversation

Copy link

Copilot AI commented May 22, 2025

Issue

The Microsoft.Windows.ApplicationModel.Background.UniversalBGTask.dll was being included in the publish output of unpackaged apps, despite only being relevant for packaged apps. This increased the size of deployment unnecessarily.

Changes

Modified the MSBuild conditions in two files to ensure the UniversalBGTask DLL is only included when both of these conditions are true:

  1. $(WindowsAppSDKBackgroundTask) is set to 'true' (existing condition)
  2. $(AppxPackage) is set to 'true' (new condition)

Files changed:

  • build/NuSpecs/WindowsAppSDK-Nuget-Native.targets
  • build/NuSpecs/WindowsAppSDK-Nuget-Native.WinRt.props

Testing

This change prevents the DLL from being copied to the output directory for unpackaged apps while maintaining the current behavior for packaged apps that need Background Task functionality.

Fixes #1.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: haonanttt <186026394+haonanttt@users.noreply.github.com>
Copilot AI changed the title [WIP] Microsoft.Windows.ApplicationModel.Background.UniversalBGTask.dll is included in output of framework-dependent unpackaged app Fix UniversalBGTask DLL inclusion in unpackaged app output May 22, 2025
Copilot AI requested a review from haonanttt May 22, 2025 07:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Microsoft.Windows.ApplicationModel.Background.UniversalBGTask.dll is included in output of framework-dependent unpackaged app

2 participants