dotnet / dotnet/msbuild

[Unhandled Exception]: Unable to set thread priority

Open
#12,677 6 comments 1 reaction 0 assignees View on GitHub
help wanted triaged
Dominant language
C#
Stars
5.5k
Forks
1.5k
Avg merge
1d 8h
Merged PRs (30d)
141

Description

### Issue Description

`dotnet restore` fails with:
```
MSBUILD : error :
This is an unhandled exception in MSBuild -- PLEASE UPVOTE AN EXISTING ISSUE OR
FILE A NEW ONE AT https://aka.ms/msbuild/unhandled
System.Threading.ThreadStateException: Unable to set thread priority.
at System.Threading.Thread.SetPriorityNative(Int32 priority)
at System.Threading.Thread.set_Priority(ThreadPriority value)
at Microsoft.Build.BackEnd.RequestBuilder.SetCommonWorkerThreadParameters()
at Microsoft.Build.BackEnd.RequestBuilder.RequestThreadProc(Boolean setThread
Parameters)

Restore failed with 1 error(s) in 2.2s
```
when running on Android via [Nix-on-droid](https://github.com/nix-community/nix-on-droid)

### Steps to Reproduce

0. Install the dotnet sdk on an Android phone via Nix-on-droid
- Will most probably require setting `DOTNET_GCHeapHardLimit` environment variable to `1C0000000`
1. Create a new project via `dotnet new console`
2. Run `dotnet restore`
### Actual Behavior

- Result of step 1: project files are created, restore fails
- Result of step 2: restore fails with the above message

### Analysis

_No response_

### Versions & Configurations

```shell
$ dotnet msbuild --version
17.15.0.35903

$ dotnet --version
10.0.100-preview.6.25358.103
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.