From c85168e526d32000fb3461afc8975c0b6d4fe845 Mon Sep 17 00:00:00 2001 From: Geert van Horrik Date: Sat, 21 Sep 2024 09:37:29 +0200 Subject: [PATCH] Use runtime identifier instead of OS architecture --- .../Internal/PlatformInformation.cs | 13 ++++++++++--- .../Services/RuntimeAssemblyResolverService.cs | 3 --- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/Orc.Extensibility/DotNetCorePlugins/Internal/PlatformInformation.cs b/src/Orc.Extensibility/DotNetCorePlugins/Internal/PlatformInformation.cs index 8017335b..54186888 100644 --- a/src/Orc.Extensibility/DotNetCorePlugins/Internal/PlatformInformation.cs +++ b/src/Orc.Extensibility/DotNetCorePlugins/Internal/PlatformInformation.cs @@ -31,8 +31,15 @@ static PlatformInformation() NativeLibraryPrefixes = new[] { string.Empty }; NativeLibraryExtensions = new[] { ".dll" }; - // For now we only care about windows - runtimeIdentifiers.Add($"win-{RuntimeInformation.OSArchitecture.ToString().ToLower()}"); + var runtimeIdentifier = RuntimeInformation.RuntimeIdentifier; + var osArchitecture = RuntimeInformation.OSArchitecture.ToString(); + + Log.Debug($"OS Architecture: {osArchitecture}"); + Log.Debug($"Runtime identifier: {runtimeIdentifier}"); + + // Note that we need to respect the process, not the OS + runtimeIdentifiers.Add(runtimeIdentifier); + //runtimeIdentifiers.Add($"win-{osArchitecture.ToLower()}"); runtimeIdentifiers.Add("win"); } else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX)) @@ -55,4 +62,4 @@ static PlatformInformation() RuntimeIdentifiers = runtimeIdentifiers.ToArray(); } -} \ No newline at end of file +} diff --git a/src/Orc.Extensibility/Services/RuntimeAssemblyResolverService.cs b/src/Orc.Extensibility/Services/RuntimeAssemblyResolverService.cs index 7833c47c..e9e76dca 100644 --- a/src/Orc.Extensibility/Services/RuntimeAssemblyResolverService.cs +++ b/src/Orc.Extensibility/Services/RuntimeAssemblyResolverService.cs @@ -35,9 +35,6 @@ public RuntimeAssemblyResolverService(IFileService fileService, IDirectoryServic _directoryService = directoryService; _assemblyReflectionService = assemblyReflectionService; _appDataService = appDataService; - - Log.Debug($"Platform identifiers: {PlatformInformation.RuntimeIdentifiers}"); - Log.Debug($"Runtime identifier: {RuntimeInformation.RuntimeIdentifier}"); } public IPluginLoadContext[] GetPluginLoadContexts()