Skip to content

chore: Upgrade to .NET 10 and enable Native AOT support#99

Open
peng5545 wants to merge 1 commit into
nref:mainfrom
peng5545:main
Open

chore: Upgrade to .NET 10 and enable Native AOT support#99
peng5545 wants to merge 1 commit into
nref:mainfrom
peng5545:main

Conversation

@peng5545
Copy link
Copy Markdown

Description

This pull request upgrades the project framework to .NET 10 and transitions the application to use Native AOT (Ahead-Of-Time) compilation, replacing the previous trimming approach. To ensure full compatibility with the Native AOT deployment model, several reflection-reliant and legacy APIs have been refactored.

Key Changes

  • Framework & Build Updates:
    • Upgraded TargetFramework from net8.0-windows to net10.0-windows.
    • Replaced <PublishTrimmed> with <PublishAot> and enabled <AllowUnsafeBlocks> in the project file.
  • Source-Generated P/Invoke (AOT Compatibility):
    • Migrated legacy [DllImport] attributes to [LibraryImport] in Win32 interop classes (BasicProcessInfo, Comctl32, Kernel32).
    • Converted affected interop classes, structs, and methods to partial to leverage compile-time interop source generation.
    • Updated string marshaling explicitly to Utf16.
  • AOT-Safe Path Resolution:
    • Refactored executable path resolution in Infrastructure/App.cs, replacing AppDomain.CurrentDomain with Environment.ProcessPath to ensure reliable behavior in AOT environments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant