Skip to content

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

Open
@sylveon

Description

@sylveon

Describe the bug

Microsoft.Windows.ApplicationModel.Background.UniversalBGTask.dll is copied to the publish output of unpackaged apps, despite not being relevant (it only applies to packaged apps).

Steps to reproduce the bug

  1. Create a new C# app using the WinUI Blank App (Packaged) template
  2. Add <WindowsPackageType>None</WindowsPackageType> to the csproj
  3. (optional) Enable NAOT by also adding <PublishAot>true</PublishAot> and upgrading the target framework to .NET 9 (this removes a lot of stuff from the output, making the issue more apparent)
  4. Set the build configuration to Release in VS
  5. In the solution explorer, right click on the project and hit publish. Then in the window that opens, hit publish, and once it finishes, hit navigate to open the published directory
  6. Observe the presence of Microsoft.Windows.ApplicationModel.Background.UniversalBGTask.dll

Expected behavior

This DLL should not be present

Screenshots

Image

NuGet package version

Windows App SDK 1.7.1: 1.7.250401001

Packaging type

Unpackaged

Windows version

Windows 11 version 24H2 (22621, October 2024 Update)

IDE

Visual Studio 2022-preview

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-DeploymentIssues related to packaging, installation, runtime (e.g., SelfContained, Unpackaged)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions