dotnet / sdk

Core functionality needed to create .NET Core projects, that is shared between Visual Studio and CLI
https://dot.net/core
MIT License
2.65k stars 1.06k forks source link

[Bug] Installed Custom Sdks in DOTNET_ROOT/packs now cant be located for loading in Visual Studio. #27329

Open AraHaan opened 2 years ago

AraHaan commented 2 years ago

Describe the bug

Let's say for example you installed a workload that installs it's own msbuild Sdks into $DOTNET_ROOT/packs along with it's reference assembly packs. Now when you load a project in Visual Studio that directly imports said Sdk the load of the project files will fail because it will look for them in $DOTNET_ROOT/sdk/[version]/Sdks and fail.

To Reproduce

To reproduce:

Exceptions (if any)

The exception is that it will not be able to find the Sdk that my cli tool does actually install.

Further technical details

.NET SDK:
 Version:   7.0.100-rc.2.22419.24
 Commit:    84d26a0707

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.22000
 OS Platform: Windows
 RID:         win10-x64
 Base Path:   C:\Program Files\dotnet\sdk\7.0.100-rc.2.22419.24\

Host:
  Version:      7.0.0-rc.1.22411.12
  Architecture: x64
  Commit:       f52d8c59bb

.NET SDKs installed:
  3.1.422 [C:\Program Files\dotnet\sdk]
  5.0.408 [C:\Program Files\dotnet\sdk]
  6.0.108 [C:\Program Files\dotnet\sdk]
  6.0.303 [C:\Program Files\dotnet\sdk]
  6.0.400 [C:\Program Files\dotnet\sdk]
  7.0.100-rc.2.22419.24 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
  Elskom.Sdk.App 6.0.0-dev [C:\Program Files\dotnet\shared\Elskom.Sdk.App]
  Microsoft.AspNetCore.App 6.0.8 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 7.0.0-rc.1.22415.4 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.EntityFrameworkCore.App 6.0.7 [C:\Program Files\dotnet\shared\Microsoft.EntityFrameworkCore.App]
  Microsoft.NETCore.App 6.0.8 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 7.0.0-rc.1.22411.12 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.WindowsDesktop.App 6.0.8 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 7.0.0-rc.1.22379.3 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Remora.Discord.App 2022.46.0 [C:\Program Files\dotnet\shared\Remora.Discord.App]
  Serilog.App 6.0.7 [C:\Program Files\dotnet\shared\Serilog.App]

Other architectures found:
  x86   [C:\Program Files (x86)\dotnet]
    registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation]

Environment variables:
  Not set

global.json file:
  Not found

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

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

Visual Studio 2022 17.4.0 Preview 1.

dotnet-issue-labeler[bot] commented 2 years ago

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

baronfel commented 7 months ago

Can you clarify? MSBuild SDKs from NuGet shouldn't be installed to the dotnet install directory - that is unsupported. The NuGet MSBuild SDK resolver should download them from NuGet feeds automatically without the user having to mutate their environment.

AraHaan commented 7 months ago

Can you clarify? MSBuild SDKs from NuGet shouldn't be installed to the dotnet install directory - that is unsupported. The NuGet MSBuild SDK resolver should download them from NuGet feeds automatically without the user having to mutate their environment.

The msbuild sdk side is directly installed in the nuget packages cache folder, but the shared framework ref pack is then stored in the install directory.