Skip to content

Wrong DOTNET_ROOT inferring on OSTree-style .NET installations #6239

@GGG-KILLER

Description

@GGG-KILLER

Environment data

VSCode version: 1.81.1
C# Extension: 2.0.413
Using OmniSharp: false

Dotnet Information .NET SDK: Version: 8.0.100-preview.5.23303.2 Commit: 3fe444af72

Runtime Environment:
OS Name: nixos
OS Version: 23.11
OS Platform: Linux
RID: linux-x64
Base Path: /nix/store/4bj5f8yjjim8wryazs31ix0npcwilpwp-dotnet-sdk-8.0.100-preview.5.23303.2/sdk/8.0.100-preview.5.23303.2/

.NET workloads installed:
There are no installed workloads to display.

Host:
Version: 8.0.0-preview.5.23280.8
Architecture: x64
Commit: bc78804f5d

.NET SDKs installed:
6.0.412 [/nix/store/5ddzdgh38p44zf5ijqfdxzndijzgw5wd-dotnet-core-combined/sdk]
7.0.306 [/nix/store/5ddzdgh38p44zf5ijqfdxzndijzgw5wd-dotnet-core-combined/sdk]
8.0.100-preview.5.23303.2 [/nix/store/5ddzdgh38p44zf5ijqfdxzndijzgw5wd-dotnet-core-combined/sdk]

.NET runtimes installed:
Microsoft.AspNetCore.App 6.0.20 [/nix/store/5ddzdgh38p44zf5ijqfdxzndijzgw5wd-dotnet-core-combined/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 7.0.9 [/nix/store/5ddzdgh38p44zf5ijqfdxzndijzgw5wd-dotnet-core-combined/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 8.0.0-preview.5.23302.2 [/nix/store/5ddzdgh38p44zf5ijqfdxzndijzgw5wd-dotnet-core-combined/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 6.0.20 [/nix/store/5ddzdgh38p44zf5ijqfdxzndijzgw5wd-dotnet-core-combined/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 7.0.9 [/nix/store/5ddzdgh38p44zf5ijqfdxzndijzgw5wd-dotnet-core-combined/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 8.0.0-preview.5.23280.8 [/nix/store/5ddzdgh38p44zf5ijqfdxzndijzgw5wd-dotnet-core-combined/shared/Microsoft.NETCore.App]

Other architectures found:
None

Environment variables:
Not set

global.json file:
Not found

Learn more:
https://aka.ms/dotnet/info

Download .NET:
https://aka.ms/dotnet/download

Steps to reproduce

  1. Install a Linux distro where .NET is installed in OSTree style (e.g. NixOS)
  2. Install the extension (and patch the binaries if you're on NixOS)
  3. Configure the extension to use the installed .NET
  4. Open a .NET project
  5. Have the extension fail with ".NET is not installed"

Expected behavior

Extension detects that the dotnet binary is in the bin dir and goes up another directory to get DOTNET_ROOT.

Actual behavior

Binary fails to launch with "Install .NET to run this binary" because of the wrong DOTNET_ROOT location.

Additional context

I have implemented a fix in the build script for my system however it'd be best if this were solved upstream.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions