diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 340a5f061..e223cf862 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -12,8 +12,8 @@ jobs: matrix: platform: [ {netversion: 6.x, targetframework: net6.0, aot: false, singleFile: true, aotString: ""}, - {netversion: 8.x, targetframework: net8.0, aot: false, singleFile: true, aotString: ""}, - {netversion: 8.x, targetframework: net8.0, aot: true, singleFile: false, aotString: " - AoT"} + {netversion: 10.x, targetframework: net10.0, aot: false, singleFile: true, aotString: ""}, + {netversion: 10.x, targetframework: net10.0, aot: true, singleFile: false, aotString: " - AoT"} ] fail-fast: false runs-on: windows-latest @@ -59,8 +59,8 @@ jobs: matrix: compiler: [gcc, clang, clang_aot] platform: [ - {os: ubuntu-22.04, path: x64}, - {os: ubuntu-22.04-arm, path: arm64} + {os: ubuntu-24.04, path: x64}, + {os: ubuntu-24.04-arm, path: arm64} ] include: - compiler: gcc @@ -81,7 +81,7 @@ jobs: - name: Install .NET Core uses: actions/setup-dotnet@v4 with: - dotnet-version: 8.x + dotnet-version: 10.x - name: Install dependencies run: | @@ -111,8 +111,8 @@ jobs: matrix: compiler: [clang_appimage] platform: [ - {os: ubuntu-22.04, name: x64, script: Linux/appimage/appimage.sh}, - {os: ubuntu-22.04-arm, name: ARM64, script: Linux/appimage/appimage-arm64.sh} + {os: ubuntu-24.04, name: x64, script: Linux/appimage/appimage.sh}, + {os: ubuntu-24.04-arm, name: ARM64, script: Linux/appimage/appimage-arm64.sh} ] runs-on: ${{ matrix.platform.os }} @@ -125,7 +125,7 @@ jobs: - name: Install .NET Core uses: actions/setup-dotnet@v4 with: - dotnet-version: 8.x + dotnet-version: 10.x - name: Install dependencies run: | @@ -173,7 +173,7 @@ jobs: - name: Install .NET Core uses: actions/setup-dotnet@v4 with: - dotnet-version: 8.x + dotnet-version: 10.x - name: Install dependencies run: | diff --git a/.github/workflows/dotnet-format-check.yml b/.github/workflows/dotnet-format-check.yml index a5faec0d0..65ceb583e 100644 --- a/.github/workflows/dotnet-format-check.yml +++ b/.github/workflows/dotnet-format-check.yml @@ -9,8 +9,8 @@ jobs: - name: Setup .NET uses: actions/setup-dotnet@v3 with: - dotnet-version: 8.0.x + dotnet-version: 10.0.x - name: Restore dependencies run: dotnet restore - name: Format - run: dotnet format --verify-no-changes --verbosity diagnostic \ No newline at end of file + run: dotnet format --verify-no-changes --verbosity diagnostic diff --git a/Linux/appimage/appimage-arm64.sh b/Linux/appimage/appimage-arm64.sh index 6046980de..f9eb12a46 100755 --- a/Linux/appimage/appimage-arm64.sh +++ b/Linux/appimage/appimage-arm64.sh @@ -1,6 +1,6 @@ #!/bin/bash -export PUBLISHFLAGS="-r linux-arm64 --no-self-contained false -p:PublishSingleFile=true -p:PublishReadyToRun=true" +export PUBLISHFLAGS="-r linux-arm64 -p:PublishSingleFile=true -p:PublishReadyToRun=true" make -j$(nproc) -O LTO=true STATICLINK=true SYSTEM_LIBEVDEV=false curl -SL https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-aarch64.AppImage -o appimagetool diff --git a/Linux/appimage/appimage.sh b/Linux/appimage/appimage.sh index a98979e4f..afec510e6 100755 --- a/Linux/appimage/appimage.sh +++ b/Linux/appimage/appimage.sh @@ -1,6 +1,6 @@ #!/bin/bash -export PUBLISHFLAGS="-r linux-x64 --no-self-contained false -p:PublishSingleFile=true -p:PublishReadyToRun=true" +export PUBLISHFLAGS="-r linux-x64 -p:PublishSingleFile=true -p:PublishReadyToRun=true" make -j$(nproc) -O LTO=true STATICLINK=true SYSTEM_LIBEVDEV=false curl -SL https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage -o appimagetool diff --git a/UI/Properties/PublishProfiles/Release.pubxml b/UI/Properties/PublishProfiles/Release.pubxml index 5e6b1eef5..899177f91 100644 --- a/UI/Properties/PublishProfiles/Release.pubxml +++ b/UI/Properties/PublishProfiles/Release.pubxml @@ -8,9 +8,9 @@ https://go.microsoft.com/fwlink/?LinkID=208121. x64 ../build/TmpReleaseBuild FileSystem - net8.0 + net10.0 win-x64 true true - \ No newline at end of file + diff --git a/UI/UI.csproj b/UI/UI.csproj index e9336ac2d..54a07435b 100644 --- a/UI/UI.csproj +++ b/UI/UI.csproj @@ -1,7 +1,7 @@  WinExe - net8.0 + net10.0 win-x64 enable true @@ -120,6 +120,7 @@ + diff --git a/UI/Utilities/EnumExtensions.cs b/UI/Utilities/EnumExtensions.cs index 411602e99..507305fe9 100644 --- a/UI/Utilities/EnumExtensions.cs +++ b/UI/Utilities/EnumExtensions.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; using System.Linq; using System.Reflection; using System.Text; @@ -9,9 +10,10 @@ namespace Mesen.Utilities { public static class EnumExtensions { + [UnconditionalSuppressMessage("Trimming", "IL2075", Justification = "Fields are not trimmed for enum types")] public static T? GetAttribute(this Enum val) where T : Attribute { - return val.GetType().GetMember(val.ToString())[0].GetCustomAttribute(); + return val.GetType().GetField(val.ToString(), BindingFlags.Public | BindingFlags.Static)!.GetCustomAttribute(); } } } diff --git a/UI/Utilities/LoadRomHelper.cs b/UI/Utilities/LoadRomHelper.cs index f4c80221b..33a57eefa 100644 --- a/UI/Utilities/LoadRomHelper.cs +++ b/UI/Utilities/LoadRomHelper.cs @@ -124,7 +124,7 @@ private static bool IsPatchFile(string filename) using(FileStream? stream = FileHelper.OpenRead(filename)) { if(stream != null) { byte[] header = new byte[5]; - stream.Read(header, 0, 5); + stream.ReadExactly(header); if(header[0] == 'P' && header[1] == 'A' && header[2] == 'T' && header[3] == 'C' && header[4] == 'H') { return true; } else if((header[0] == 'U' || header[0] == 'B') && header[1] == 'P' && header[2] == 'S' && header[3] == '1') { diff --git a/UI/Utilities/ReactiveHelper.cs b/UI/Utilities/ReactiveHelper.cs index 9f87ab782..299099d39 100644 --- a/UI/Utilities/ReactiveHelper.cs +++ b/UI/Utilities/ReactiveHelper.cs @@ -4,18 +4,19 @@ using System.Collections; using System.Collections.Generic; using System.ComponentModel; +using System.Diagnostics.CodeAnalysis; using System.Reflection; namespace Mesen.Utilities { public static class ReactiveHelper { - public static IDisposable RegisterRecursiveObserver(ReactiveObject target, PropertyChangedEventHandler handler) + public static IDisposable RegisterRecursiveObserver<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicProperties)] T>(T target, PropertyChangedEventHandler handler) where T : ReactiveObject { Dictionary observableObjects = new(); Dictionary props = new(); - foreach(PropertyInfo prop in target.GetType().GetProperties(BindingFlags.Instance | BindingFlags.Public)) { + foreach(PropertyInfo prop in typeof(T).GetProperties(BindingFlags.Instance | BindingFlags.Public)) { if(prop.GetCustomAttribute() != null) { object? value = prop.GetValue(target); if(value is ReactiveObject propValue) { @@ -55,9 +56,9 @@ public static IDisposable RegisterRecursiveObserver(ReactiveObject target, Prope return new RecursiveObserver(target, handler); } - public static void UnregisterRecursiveObserver(ReactiveObject target, PropertyChangedEventHandler handler) + public static void UnregisterRecursiveObserver<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicProperties)] T>(T target, PropertyChangedEventHandler handler) where T : ReactiveObject { - foreach(PropertyInfo prop in target.GetType().GetProperties(BindingFlags.Instance | BindingFlags.Public)) { + foreach(PropertyInfo prop in typeof(T).GetProperties(BindingFlags.Instance | BindingFlags.Public)) { if(prop.GetCustomAttribute() != null) { object? value = prop.GetValue(target); if(value is ReactiveObject propValue) { diff --git a/UI/ViewModels/ViewModelBase.cs b/UI/ViewModels/ViewModelBase.cs index abd243621..54c5dda1b 100644 --- a/UI/ViewModels/ViewModelBase.cs +++ b/UI/ViewModels/ViewModelBase.cs @@ -2,9 +2,11 @@ using System; using System.Collections; using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; namespace Mesen.ViewModels { + [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicProperties)] public class ViewModelBase : ReactiveObject { } diff --git a/UI/global.json b/UI/global.json index 9bc2d8144..5ee679fe4 100644 --- a/UI/global.json +++ b/UI/global.json @@ -1,6 +1,6 @@ { "sdk": { "rollForward": "latestFeature", - "version": "8.0.0" + "version": "10.0.0" } -} \ No newline at end of file +} diff --git a/makefile b/makefile index 67bc9cbb3..d266294b2 100644 --- a/makefile +++ b/makefile @@ -131,7 +131,7 @@ endif ifeq ($(USE_AOT),true) PUBLISHFLAGS ?= -r $(MESENPLATFORM) -p:PublishSingleFile=false -p:PublishAot=true -p:SelfContained=true else - PUBLISHFLAGS ?= -r $(MESENPLATFORM) --no-self-contained true -p:PublishSingleFile=true + PUBLISHFLAGS ?= -r $(MESENPLATFORM) --no-self-contained -p:PublishSingleFile=true endif