dotnet / dotnet/sdk

Tests in this repo can't be run simply with `dotnet test`

Open
#56,067 0 comments 0 reactions 0 assignees View on GitHub
Area-Infrastructure untriaged
Dominant language
C#
Stars
3.2k
Forks
1.3k
PR merge metrics
PR metrics pending

Description

(Updated a bit after more investigation. I guess this might be actually a VSCode / C# DevKit bug since this works in normal terminal, but DevKit probably messes with the inner terminal's DOTNET_ROOT or something. Leaving open anyway in case this is somehow a config bug on sdk side.)

1. Clone `main` of dotnet/sdk
2. Run `.\build.cmd`
3. Run `. .\artifacts\sdk-build-env.bat; .\eng\print-full-msbuild-path.ps1`
4. Run `code .\sdk.code-workspace` to open VSCode in this directory
5. Run `dotnet test .\test\dotnet.Tests\` in VSCode terminal
6. Fails with
```
Exit code: -2147450730
Error output: You must install or update .NET to run this application.

App: C:\repos\sdk\artifacts\bin\redist\Debug\dotnet.Tests.exe
Architecture: x64
Framework: 'Microsoft.NETCore.App', version '11.0.0-rc.1.26410.101' (x64)
.NET location: C:\repos\sdk\.dotnet
```
6. Run `$env:DOTNET_ROOT = (Resolve-Path .\.dotnet\).Path`
7. Now `dotnet test` works

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the sequence in the issue using .\build.cmd, the SDK build environment, sdk.code-workspace, and `dotnet test .\test\dotnet.Tests\`; compare the VSCode terminal with a normal terminal. Inspect how DOTNET_ROOT is set in each environment. Done means the tests run from the VSCode terminal without manually assigning DOTNET_ROOT, or the responsible configuration is clearly identified.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, powershell, vscode
Domain
developer-experience, testing, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.