microsoft / microsoft/CsWinRT

Bug: Fails to build when project name starts with a number

Open
#2,563 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
665
Forks
134
Avg merge
1d 3h
Merged PRs (30d)
32

Description

Description

I created a C# WinUI3 project that starts with a number and it fails to build.

Steps To Reproduce
  1. Create a new C# WinUI3 project using the project template, named "1-HelloWorld" (doesn't matter whether it creates the solution in the same folder with the project or not)
  2. Build it
Expected Behavior

Builds fine. C++WinRT handles this scenario correctly.

Version Info
  • Microsoft.WindowsAppSDK 2.4.0
  • Microsoft.Windows.SDK.BuildTools 10.0.28000.2705

which includes WinRT.Runtime.dll version 2.2.0.48161

Additional Context

C++WinRT will prepend an underscore for the namespace name.

Contributor guide

Open the contributing guide

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

Reproduce the failure by creating and building a C# WinUI3 project named "1-HelloWorld". Trace the project-template build and namespace-generation path, using the C++/WinRT underscore behavior in the issue as context; done means the numeric-prefixed project builds successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
build-system, desktop
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.