microsoft / microsoft/WindowsAppSDK

Project Templates default to ApplicationType="Windows Store", filtering out Desktop APIs

Open
#5,500 0 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area-WinAppSDK:Templates Status: Reviewed
Dominant language
C++
Stars
4.7k
Forks
471
Avg merge
3d 13h
Merged PRs (30d)
28

Description

### Describe the bug

Some Windows APIs are Desktop-specific (not UWP), such as Windows.AI.Actions. The Project Templates are still setting ApplicationType to "Windows Store", which in turn sets TargetPlatformIdentifier to UAP, which in turn limits what Windows API contracts are projected by C++/WinRT. This can be worked around by changing/removing the ApplicationType property, or adding the Desktop Extension SDK. But ideally, the project templates should include all Windows SDK Desktop APIs in the C++/WinRT projection header generation.

### Steps to reproduce the bug

1. Create a new app from the WinUI3 Packaged C++ project template.
2. Add #include to a source file
3. Compile and observe:
error C1083: Cannot open include file: 'winrt/Windows.AI.Actions.Provider.h': No such file or directory

### Expected behavior

No error, with all Windows SDK Desktop APIs projected

### Screenshots

_No response_

### NuGet package version

None

### Packaging type

_No response_

### Windows version

_No response_

### IDE

_No response_

### Additional context

_No response_

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the WinUI3 Packaged C++ project template and inspect how its ApplicationType setting produces TargetPlatformIdentifier=UAP. Reproduce the missing winrt/Windows.AI.Actions.Provider.h include, then verify that the template projects the Windows SDK Desktop APIs and the sample include compiles.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
desktop
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.