microsoft / microsoft-ui-xaml

Windows UI Library: the latest Windows 10 native controls and Fluent styles for your applications
MIT License
6.35k stars 678 forks source link

C++/WinRT WinUI 3.0 basic template fails to compile with C++20 #5547

Open pjmlp opened 3 years ago

pjmlp commented 3 years ago

Describe the bug

Compilation fails with

c1xx : fatal error C1083: Cannot open source file: 'Generated Files\XamlTypeInfo.g.cpp': No such file or directory

Steps to reproduce the bug

  1. Create a new Solution based on the WinUI 3.0 C++/WinRT template for desktop (Blank application)
  2. Enable the compiler option Scan Sources for Module Dependencies
  3. Change the C++ language version to C++latest (preview), aka C++20 for VS 2019
  4. Update the NuGET packages to the latest version (C++/WinRT is 2.0.210722.2)

Expected behavior

A project freshly generated from a Visual Studio template should compile without errors, even when changing from C++17 to C++20 version, and updating the respective NuGET versions to the latest ones.

Screenshots

Version Info

Microsoft Visual Studio Community 2019 Version 16.10.4 VisualStudio.16.Release/16.10.4+31515.178 Microsoft .NET Framework Version 4.8.04084

Installed Version: Community

Visual C++ 2019 00435-60000-00000-AA764 Microsoft Visual C++ 2019

ASP.NET and Web Tools 2019 16.10.526.50910 ASP.NET and Web Tools 2019

Azure App Service Tools v3.0.0 16.10.526.50910 Azure App Service Tools v3.0.0

C# Tools 3.10.0-4.21329.37+246ce641f04b67ef017655275d850bf902a8e40f C# components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Common Azure Tools 1.10 Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

IntelliCode Extension 1.0 IntelliCode Visual Studio Extension Detailed Info

Microsoft JVM Debugger 1.0 Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines

Microsoft MI-Based Debugger 1.0 Provides support for connecting Visual Studio to MI compatible debuggers

Microsoft Visual C++ Wizards 1.0 Microsoft Visual C++ Wizards

Microsoft Visual Studio VC Package 1.0 Microsoft Visual Studio VC Package

Node.js Tools 1.5.30310.1 Commit Hash:e550dd1b679956810ccace4368dbc7a64443213b Adds support for developing and debugging Node.js apps in Visual Studio

NuGet Package Manager 5.10.0 NuGet Package Manager in Visual Studio. For more information about NuGet, visit https://docs.nuget.org/

ProjectServicesPackage Extension 1.0 ProjectServicesPackage Visual Studio Extension Detailed Info

Syntax Visualizer 1.0 An extension for visualizing Roslyn SyntaxTrees.

Test Adapter for Google Test 1.0 Enables Visual Studio's testing tools with unit tests written for Google Test. The use terms and Third Party Notices are available in the extension installation directory.

TypeScript Tools 16.0.30429.2002 TypeScript Tools for Microsoft Visual Studio

Visual Basic Tools 3.10.0-4.21329.37+246ce641f04b67ef017655275d850bf902a8e40f Visual Basic components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Visual F# Tools 16.10.0-beta.21262.7+1b23bbeda88ea3cb9be9af777f4c99fa8663df81 Microsoft Visual F# Tools

Visual Studio Code Debug Adapter Host Package 1.0 Interop layer for hosting Visual Studio Code debug adapters in Visual Studio

Visual Studio Tools for CMake 1.0 Visual Studio Tools for CMake build.log

NuGet package version: grafik

Additional context

pjmlp commented 3 years ago

Apparently this is caused by enabling "Scan Sources for Module Dependencies" to yes.

C++/WinRT team blames the XAML compiler:

https://github.com/microsoft/cppwinrt/issues/988

Where to actually report the issue with failed generation of the C++ bindings for C++/WinRT?

Is this now correct here, or do I need to report this issue yet again somewhere else?

StephenLPeters commented 3 years ago

This is the correct repo

@RealTommyKlein and @evelynwu-msft FYI

oaVa-o commented 1 year ago

Hi, this is still an issue as far as I can tell.