Skip to content

C++/WinRT - including the Microsoft.Windows.AppLifecycle.h header file causes issues #1901

@jaigak

Description

@jaigak

Describe the bug

When you include the Microsoft.Windows.AppLifecycle.h (or any other header that starts with Microsoft.Windows), it causes issues in other AppSDK headers included after that (eg: Microsoft.UI.Xaml.h) since the generated code references types under the Windows::Foundation namespace but the compiler thinks that it's the Microsoft::Windows::Foundation namespace which doesn't exist.

Steps to reproduce the bug

  1. Include any header that starts with "Microsoft.Windows" before other AppSDK headers.
  2. See the error.

Expected behavior

This should compile and work. Including the header, after all other AppSDK headers works but shouldn't be necessary.

Screenshots

Screenshot 2021-12-12 at 16 52 30

NuGet package version

1.0.0

Packaging type

Packaged (MSIX)

Windows version

Windows 10 version 21H2 (19044, November 2021 Update)

IDE

Visual Studio 2022

Additional context

No response

Metadata

Metadata

Assignees

Labels

area-DeveloperToolsIssues related to authoring (source and IDL), debugging, HotReload, LiveVisualTree, VS integrationbugSomething isn't working

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions