From 07d5fce0747f26f72b6c026660f02384038da06b Mon Sep 17 00:00:00 2001 From: glopesdev Date: Mon, 3 Jul 2023 08:53:02 +0100 Subject: [PATCH 1/2] Add net6.0 build target to player project --- Bonsai.Configuration/Bonsai.Configuration.csproj | 2 +- Bonsai.Configuration/ConfigurationHelper.cs | 6 +++--- Bonsai.Configuration/ScriptExtensionsProvider.cs | 4 +++- Bonsai.NuGet/Bonsai.NuGet.csproj | 9 +++++++-- Bonsai.Player/Bonsai.Player.csproj | 6 +++--- 5 files changed, 17 insertions(+), 10 deletions(-) diff --git a/Bonsai.Configuration/Bonsai.Configuration.csproj b/Bonsai.Configuration/Bonsai.Configuration.csproj index 48acb000c..a9481233c 100644 --- a/Bonsai.Configuration/Bonsai.Configuration.csproj +++ b/Bonsai.Configuration/Bonsai.Configuration.csproj @@ -3,7 +3,7 @@ false false - net472 + net472;netstandard2.0 2.8.0 diff --git a/Bonsai.Configuration/ConfigurationHelper.cs b/Bonsai.Configuration/ConfigurationHelper.cs index e0b8478d5..454bedcba 100644 --- a/Bonsai.Configuration/ConfigurationHelper.cs +++ b/Bonsai.Configuration/ConfigurationHelper.cs @@ -40,9 +40,9 @@ static void AddLibraryPath(string path) public static string GetConfigurationRoot(PackageConfiguration configuration = null) { - return configuration == null || string.IsNullOrWhiteSpace(configuration.ConfigurationFile) - ? Path.GetDirectoryName(AppDomain.CurrentDomain.SetupInformation.ConfigurationFile) - : Path.GetDirectoryName(configuration.ConfigurationFile); + return !string.IsNullOrWhiteSpace(configuration?.ConfigurationFile) + ? Path.GetDirectoryName(configuration.ConfigurationFile) + : AppDomain.CurrentDomain.BaseDirectory; } public static string GetAssemblyLocation(this PackageConfiguration configuration, string assemblyName) diff --git a/Bonsai.Configuration/ScriptExtensionsProvider.cs b/Bonsai.Configuration/ScriptExtensionsProvider.cs index 2c483074b..48c507fd1 100644 --- a/Bonsai.Configuration/ScriptExtensionsProvider.cs +++ b/Bonsai.Configuration/ScriptExtensionsProvider.cs @@ -1,4 +1,5 @@ -using Microsoft.CSharp; +#if NET472_OR_GREATER +using Microsoft.CSharp; using NuGet.Common; using NuGet.Configuration; using NuGet.Frameworks; @@ -179,3 +180,4 @@ string GetAssemblyLocation(string fileName) } } } +#endif diff --git a/Bonsai.NuGet/Bonsai.NuGet.csproj b/Bonsai.NuGet/Bonsai.NuGet.csproj index dd12bd707..13bd8b3a1 100644 --- a/Bonsai.NuGet/Bonsai.NuGet.csproj +++ b/Bonsai.NuGet/Bonsai.NuGet.csproj @@ -3,11 +3,16 @@ false false - net472 + net472;netstandard2.0 2.8.0 - + + + + + + diff --git a/Bonsai.Player/Bonsai.Player.csproj b/Bonsai.Player/Bonsai.Player.csproj index b08ec25f7..f719b22cd 100644 --- a/Bonsai.Player/Bonsai.Player.csproj +++ b/Bonsai.Player/Bonsai.Player.csproj @@ -6,10 +6,10 @@ A command line player for Bonsai workflows. Bonsai Player Rx Reactive Extensions false - net472 + net472;net6.0 2.8.0 - + all runtime; build; native; contentfiles; analyzers; buildtransitive @@ -19,7 +19,7 @@ - + $(MSBuildThisFileDirectory)bin\$(Configuration)\$(TargetFramework) From c822b8c85cad7390a080296905795241c6f67246 Mon Sep 17 00:00:00 2001 From: glopesdev Date: Mon, 3 Jul 2023 09:21:57 +0100 Subject: [PATCH 2/2] Allow loading ARM specific runtime libraries --- Bonsai.Configuration/ConfigurationHelper.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Bonsai.Configuration/ConfigurationHelper.cs b/Bonsai.Configuration/ConfigurationHelper.cs index 454bedcba..885726b0b 100644 --- a/Bonsai.Configuration/ConfigurationHelper.cs +++ b/Bonsai.Configuration/ConfigurationHelper.cs @@ -6,6 +6,7 @@ using System.IO; using System.Linq; using System.Reflection; +using System.Runtime.InteropServices; using System.Xml; using System.Xml.Serialization; @@ -19,7 +20,7 @@ public static class ConfigurationHelper static string GetEnvironmentPlatform() { - return Environment.Is64BitProcess ? "x64" : "x86"; + return RuntimeInformation.ProcessArchitecture.ToString().ToLowerInvariant(); } static string GetDefaultConfigurationFilePath()