Uh oh!
There was an error while loading. Please reload this page.
win32: add fallback to environment vars for system folder - #109673
Conversation
Tagging subscribers to this area: @dotnet/area-system-runtime |
7581043 to
da047d7CompareImplement fallback to environment variables for system folders in NanoServer, ensuring correct paths when SHGetKnownFolderPath fails.
| result.Should().Contain(PackagesPath); | ||
| } | ||
| [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWindowsNanoServer))] // https://github.com/dotnet/runtime/issues/21430 |
There was a problem hiding this comment.
@ViktorHofer@akoeplinger I removed this condition, and it's now passing where it was failing before: link to comment. I didn’t update other environment tests since they compare values against win32 SHGetFolderPathW, which returns a general error (-2147467259) on nano server
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
kasperk81
commented
Nov 17, 2024
jkotas
commented
Nov 18, 2024
I am leaving it to @dotnet/area-system-runtime owners to do the final signoff and merge. |
ViktorHofer
commented
Dec 17, 2024
gentle ping @dotnet/area-system-runtime |
| Guid folderId = new Guid(folderGuid); | ||
| int hr = Interop.Shell32.SHGetKnownFolderPath(folderId, (uint)option, IntPtr.Zero, out string path); |
There was a problem hiding this comment.
This function is part of the shell experience, so desktop only. So I'm not surprised that it fails on systems without shell. This will probably also fix usages in system services, etc. And probably everything else where no user registry hives are loaded.
* main: (31 commits) Fix linux-x86 build (dotnet#111861) Add FrozenDictionary specialization for integers / enums (dotnet#111886) [SRM] Refactor reading from streams. (dotnet#111323) Sign the DAC and DBI during the build process instead of in separate steps (dotnet#111416) Removing Entry2MethodDesc as it is unnecessary (dotnet#111756) Cross Product for Vector2 and Vector4 (dotnet#111265) Handle unicode in absolute URI path for combine. (dotnet#111710) Drop RequiresProcessIsolation on mcc tests (dotnet#111887) [main] Update dependencies from dotnet/roslyn (dotnet#111691) new trimmer feature System.TimeZoneInfo.Invariant (dotnet#111215) [browser] reduce msbuild memory footprint (dotnet#111751) Add debugging checks for stack overflow tests failure (dotnet#111867) Localized file check-in by OneLocBuild Task: Build definition ID 679: Build ID 2629821 (dotnet#111884) Bump main to preview2 (dotnet#111882) Avoid generic virtual dispatch for frozen collections alternate lookup (dotnet#108732) Bump main versioning to preview1 (dotnet#111880) Switch OneLoc to main (dotnet#111872) Improve docs on building ILVerify (dotnet#111851) Update Debian version to 13 (dotnet#111768) win32: add fallback to environment vars for system folder (dotnet#109673) ...
Implement fallback to environment variables for system folders in NanoServer, ensuring correct paths when SHGetKnownFolderPath fails.
in base nanoserver image, all values are returning empty
both
SHGetFolderPathWandSHGetKnownFolderPathfail with error -2147467259.environment variables in the base image:
docker run --rm mcr.microsoft.com/windows/nanoserver:ltsc2022 cmd /c "set"