Skip to content

winapp init should add asset files as Content items in the csproj #444

@nmetulev

Description

@nmetulev

Description

When running winapp init, the generated asset files (StoreLogo, AppList, MedTile, WideTile, etc.) are placed in the Assets\ folder but are not added as <Content> items in the .csproj. This causes the MSIX tooling to exclude them from the generated .build.appxrecipe file, meaning the package layout is missing the visual assets referenced in Package.appxmanifest.

This is not limited to a specific project type (e.g. WPF) — any project that doesn't automatically treat image files as Content items will have this problem. The <Content> items should be added to the csproj for all project types during winapp init.

Steps to Reproduce

  1. Create a project and run winapp init
  2. Run dotnet build
  3. Inspect the generated .build.appxrecipe in the output folder — no Assets\* entries are present

Expected Behavior

The assets should be added as <Content> items in the csproj during winapp init, e.g.:

<ItemGroup>
  <Content Include="Assets\StoreLogo.png" />
  <Content Include="Assets\MedTile.png" />
  <Content Include="Assets\MedTile.scale-200.png" />
  <Content Include="Assets\AppList.png" />
  <Content Include="Assets\AppList.scale-200.png" />
  <Content Include="Assets\AppList.targetsize-24_altform-unplated.png" />
  <Content Include="Assets\WideTile.png" />
  <Content Include="Assets\WideTile.scale-200.png" />
</ItemGroup>

Actual Behavior

No <Content> items are added for the generated assets. Project SDKs that don't auto-include image files as Content (such as WPF's UseWPF) will result in the MSIX build tooling never picking up the assets.

Additional Context

WinUI projects created via the Visual Studio template already include explicit <Content> items for assets, which is why they work correctly. The winapp init flow should do the same for all project types.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions