Check for dotnet.dll when enumerating SDK paths (#89333)
authorElinor Fung <elfung@microsoft.com>
Wed, 26 Jul 2023 22:32:59 +0000 (15:32 -0700)
committerGitHub <noreply@github.com>
Wed, 26 Jul 2023 22:32:59 +0000 (15:32 -0700)
commit08acbb7ad7154e9d18227e4b00e4c9f41af1fffa
tree8c7a633081cb271ef43f48af607df456b7534c44
parentd4d0812e3b882e0d844e1877eb62b893cd26bbff
Check for dotnet.dll when enumerating SDK paths (#89333)

The host treats the existence of a versioned folder under sdk as a valid SDK path. We've seen this cause confusion as users can end up in this state without their knowledge (for example, uninstall leaves an empty folder - which would normally be harmless, except when we try to use it as a valid SDK).

This adds a check for dotnet.dll instead of just the existence of the directory.
src/installer/tests/HostActivation.Tests/NativeHostApis.cs
src/installer/tests/HostActivation.Tests/SDKLookup.cs
src/native/corehost/fxr/fx_muxer.cpp
src/native/corehost/fxr/sdk_info.cpp
src/native/corehost/fxr/sdk_info.h
src/native/corehost/fxr/sdk_resolver.cpp
src/native/corehost/hostmisc/utils.h