From 636a078c3baac1ee9163595f1e81fa878a689805 Mon Sep 17 00:00:00 2001 From: REDCODE Date: Sat, 13 Jun 2026 13:18:28 +0200 Subject: [PATCH] net8.0: upgrade from netcoreapp3.1, fix Linux rendering MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - TFM: netcoreapp3.1 → net8.0, netstandard2.1 → net8.0 - System.Drawing.Common 5.0.3 → 6.0.0 (last version with Unix support) - Remove stale packages (NETStandard.Library, System.Collections) - Set System.Drawing.EnableUnixSupport via runtimeconfig + AppContext - Pin System.Resources.Extensions 8.0.0, suppress NU1603 - Copy game_folder assets to build output (no run.sh required) - Sta.CurrentDirectory → AppContext.BaseDirectory for portable path resolution - Enable UnsafeBinaryFormatterSerialization + InvariantGlobalization - Add global.json pinning SDK to 8.x - Remove ambiguous `using System.Net.Mime.MediaTypeNames` in ParT.cs - Add `using System.Reflection` to Program.cs --- 2DGAMELIB/2DGAMELIB.csproj | 16 ++++++++-------- 2DGAMELIB/_2DGAMELIB/ParT.cs | 1 - SlaveMatrix/Properties/launchSettings.json | 5 ++++- SlaveMatrix/SlaveMatrix.csproj | 9 ++++++++- SlaveMatrix/SlaveMatrix/GameClasses/Program.cs | 6 +++++- SlaveMatrix/SlaveMatrix/GameClasses/Sta.cs | 2 +- SlaveMatrix/runtimeconfig.template.json | 5 +++++ global.json | 7 +++++++ 8 files changed, 38 insertions(+), 13 deletions(-) create mode 100644 SlaveMatrix/runtimeconfig.template.json create mode 100644 global.json diff --git a/2DGAMELIB/2DGAMELIB.csproj b/2DGAMELIB/2DGAMELIB.csproj index 6f15fff..36ea877 100644 --- a/2DGAMELIB/2DGAMELIB.csproj +++ b/2DGAMELIB/2DGAMELIB.csproj @@ -3,26 +3,26 @@ 2DGAMELIB False - True - netstandard2.1 + net8.0 x64 - AnyCPU 9.0 True - true + true + false + SYSLIB0011;CA1416 - - - - + + + NU1603 + \ No newline at end of file diff --git a/2DGAMELIB/_2DGAMELIB/ParT.cs b/2DGAMELIB/_2DGAMELIB/ParT.cs index 7b85a4f..e3e4464 100644 --- a/2DGAMELIB/_2DGAMELIB/ParT.cs +++ b/2DGAMELIB/_2DGAMELIB/ParT.cs @@ -2,7 +2,6 @@ using Newtonsoft.Json; using System; using System.Drawing; using System.Drawing.Drawing2D; -using static System.Net.Mime.MediaTypeNames; namespace _2DGAMELIB { diff --git a/SlaveMatrix/Properties/launchSettings.json b/SlaveMatrix/Properties/launchSettings.json index e73cfc4..3923c68 100644 --- a/SlaveMatrix/Properties/launchSettings.json +++ b/SlaveMatrix/Properties/launchSettings.json @@ -2,7 +2,10 @@ "profiles": { "SlaveMatrix": { "commandName": "Project", - "workingDirectory": "$(SolutionDir)\\game_folder" + "workingDirectory": "../game_folder", + "environmentVariables": { + "DOTNET_SYSTEM_GLOBALIZATION_INVARIANT": "true" + } }, "WSL": { "commandName": "WSL2", diff --git a/SlaveMatrix/SlaveMatrix.csproj b/SlaveMatrix/SlaveMatrix.csproj index 3595ef2..a4aae05 100644 --- a/SlaveMatrix/SlaveMatrix.csproj +++ b/SlaveMatrix/SlaveMatrix.csproj @@ -4,7 +4,7 @@ SlaveMatrix False WinExe - netcoreapp3.1 + net8.0 x64 @@ -14,10 +14,17 @@ app.ico + true + true + true + CA1416 + + + True diff --git a/SlaveMatrix/SlaveMatrix/GameClasses/Program.cs b/SlaveMatrix/SlaveMatrix/GameClasses/Program.cs index 260a122..7592b04 100644 --- a/SlaveMatrix/SlaveMatrix/GameClasses/Program.cs +++ b/SlaveMatrix/SlaveMatrix/GameClasses/Program.cs @@ -1,15 +1,19 @@ using System; +using System.Reflection; using _2DGAMELIB; namespace SlaveMatrix { internal static class Program { + static Program() + { + AppContext.SetSwitch("System.Drawing.EnableUnixSupport", true); + } [STAThread] private static void Main(string[] A_0) { - Sta.LoadConfig(); double percent = 35.0; diff --git a/SlaveMatrix/SlaveMatrix/GameClasses/Sta.cs b/SlaveMatrix/SlaveMatrix/GameClasses/Sta.cs index d992f31..de07d0a 100644 --- a/SlaveMatrix/SlaveMatrix/GameClasses/Sta.cs +++ b/SlaveMatrix/SlaveMatrix/GameClasses/Sta.cs @@ -1410,7 +1410,7 @@ namespace SlaveMatrix 上着B_クロス初期化 = default(上着B_クロス情報); 上着B_前掛け初期化 = default(上着B_前掛け情報); ブーツ初期化 = default(ブーツ情報); - CurrentDirectory = Directory.GetCurrentDirectory(); + CurrentDirectory = AppContext.BaseDirectory; GameData = new GameState(); SavePath = Path.Combine(CurrentDirectory, "save"); ImiPath = Path.Combine(CurrentDirectory, "text", "Basement", "Training", "Imitation.txt"); diff --git a/SlaveMatrix/runtimeconfig.template.json b/SlaveMatrix/runtimeconfig.template.json new file mode 100644 index 0000000..6906ea9 --- /dev/null +++ b/SlaveMatrix/runtimeconfig.template.json @@ -0,0 +1,5 @@ +{ + "configProperties": { + "System.Drawing.EnableUnixSupport": true + } +} diff --git a/global.json b/global.json new file mode 100644 index 0000000..dad2db5 --- /dev/null +++ b/global.json @@ -0,0 +1,7 @@ +{ + "sdk": { + "version": "8.0.0", + "rollForward": "latestMajor", + "allowPrerelease": true + } +} \ No newline at end of file