dotnet / dotnet/wpf

Native tools bootstrap failed

Open
#7,044 15 comments 0 reactions 1 assignee Claimed by @pchaurasia14 View on GitHub
Investigate
Dominant language
C#
Stars
7.7k
Forks
1.3k
Avg merge
1d 11h
Merged PRs (30d)
61

Description

**Problem description:**

When I tried to run build.cmd to compile , I always got the messages like this:

Processing D:\Repos\wpf\global.json
**strawberry-perl was not found in C:\Users\bruceshen\\.netcoreeng\native\bin\strawberry-perl\5.28.1.1-1\.
net-framework-48-ref-assemblies was not found in C:\Users\bruceshen\\.netcoreeng\native\bin\net-framework-48-ref-assemblies\0.0.0.1\.
Native tools bootstrap failed**
Attempting to install dotnet from public location.
dotnet-install: Note that the intended use of this script is for Continuous Integration (CI) scenarios, where:
dotnet-install: - The SDK needs to be installed without user interaction and without admin rights.
dotnet-install: - The SDK installation doesn't need to persist across multiple CI runs.
dotnet-install: To set up a development environment or to run apps, use installers rather than this script. Visit https://dotnet.microsoft.com/download to get the installer.

I checked the installation path, confusingly, the native tools were successfully installed, so I had to consider that this was a bug. Turns out, I was right.

See the code of power shell script in [install-tool.ps1](https://github.com/dotnet/wpf/blob/main/eng/common/native/install-tool.ps1#L103), it assumes all native tools are executable and have the name of $ToolName. In fact, the executable file name of strawberry-perl is perl.exe, even more net-framework-48-ref-assemblies is just a library.

```
$ToolFilePath = Get-ChildItem $ToolInstallDirectory -Recurse -Filter "$ToolName.exe" | % { $_.FullName }
if (@($ToolFilePath).Length -Gt 1) {
Write-Error "There are multiple copies of $ToolName in $($ToolInstallDirectory): `n$(@($ToolFilePath | out-string))"
exit 1
} elseif (@($ToolFilePath).Length -Lt 1) {
Write-Host "$ToolName was not found in $ToolInstallDirectory."
exit 1
}
```

**Actual behavior:**

**Expected behavior:**

**Minimal repro:**

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.