microsoft / microsoft/PowerToys

Issues compiling PowerToys from a clean clone on ARM64

Open
#45,281 0 comments 0 reactions 0 assignees View on GitHub
Area-Build Issue-Docs Needs-Triage Product-Command Palette
Dominant language
C
Stars
139k
Forks
8.6k
PR merge metrics
PR metrics pending

Description

This issue lists several problems I encountered while trying to build PowerToys on **Windows 11 ARM** from a clean state, immediately after cloning the repository. I think they are both documentation issues and things that have to be fixed in the code (Visual Studio project / solution files).

_Note: I initially mentioned some of these problems in the comments of issue #43444, but they appear to be distinct, reproducible build issues that warrant this dedicated issue._

The build was performed using:

* **Windows 11 Pro (ARM64)**
* **Visual Studio 2022 (latest update at the time of writing)**
* Running inside a **Parallels VM on a MacBook Pro M5** (I don’t believe the VM or host platform should materially affect these issues, but I mention it for completeness).

The current **DevDocs wiki** lists build steps that did not work for me when starting from a clean clone.

---

### Repro steps

1. Clone the PowerToys repository
2. Initialize submodules: `git submodule update --init --recursive`
3. Open `PowerToys.slnx` in Visual Studio 2022
4. Select **ARM64** / **Debug**
5. Build the solution

---

### Issues encountered

#### 1. Race condition during first (parallel) build – MIDL / WINMD generation

On the first build, project `Microsoft.CommandPalette.Extensions.vcxproj` fails to compile.

Symptoms:

* MIDL-generated symbols such as `IInspectable` cannot be found
* No `.winmd` file is generated
* The failure only happens on the initial parallel build

This looks like a race condition in the MIDL step. I was able to fix these by manually doing a restore before building:
```
msbuild PowerToys.slnx /t:Restore /p:Platform=ARM64 /p:Configuration=Debug
```

---

#### 2. `LightSwitchService` cannot copy `PowerToys.ManagedCommon.dll`

After resolving the MIDL issues, the build fails again:

* `LightSwitchService` is unable to copy `PowerToys.ManagedCommon.dll`
* In Solution Explorer, `ManagedCommon` appears under References with a yellow warning triangle
* It looks like the Project Reference (and resulting Build Order) is not being respected during build

I managed to fix this by manually adding an explicit **Project Dependency**:

* `Project` → `Project Dependencies`
* Make `LightSwitchService` depend on `ManagedCommon`

After doing this, the PowerToys build succeeds.

Contributor guide

Open the contributing guide

Research direction

Start with PowerToys.slnx, Microsoft.CommandPalette.Extensions.vcxproj, and the LightSwitchService/ManagedCommon project relationship. Reproduce the clean-clone ARM64/Debug build and compare it with the documented msbuild restore command and the reported manual project dependency. Done means the solution builds successfully from a clean clone without manual restore or dependency changes.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, git
Domain
build-system, devtools, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.