Skip to content

[WIP] Fix compile errors for PublishTrimmed option#238

Draft
Copilot wants to merge 2 commits intomasterfrom
copilot/enable-publishtrimmed-compile-option
Draft

[WIP] Fix compile errors for PublishTrimmed option#238
Copilot wants to merge 2 commits intomasterfrom
copilot/enable-publishtrimmed-compile-option

Conversation

Copy link
Contributor

Copilot AI commented Mar 17, 2026

  • Add PublishTrimmed=true to Gui.csproj and update build.sh
  • Fix Common/JsonFile.cs: Add [RequiresUnreferencedCode] to generic JSON methods
  • Fix Common/VersionHelpers.cs: Use JsonSerializerContext source generation for VersionCheckBody
  • Fix Common/Logging/Logger.cs: Suppress StackFrame.GetMethod() IL2026
  • Fix Common/Logging/ReflectionLogger.cs: Add [RequiresUnreferencedCode] and [DynamicallyAccessedMembers]
  • Fix Dat/FileParsing/AttributeHelper.cs: Add [DynamicallyAccessedMembers]
  • Fix Dat/FileParsing/ByteReader.cs: Add [RequiresUnreferencedCode] and [DynamicallyAccessedMembers]
  • Fix Dat/FileParsing/ByteWriter.cs: Add [DynamicallyAccessedMembers]
  • Fix Dat/FileParsing/SawyerStreamReader.cs: Suppress ValidationContext IL2026
  • Fix Dat/FileParsing/SawyerStreamWriter.cs: Suppress Validator.TryValidateObject IL2026
  • Fix Definitions/ObjectModels/Objects: Suppress LengthAttribute/ValidationContext IL2026 warnings
  • Fix Definitions/ObjectModels/Serialization/LocoObjectJsonConverter.cs: Add [RequiresUnreferencedCode]
  • Fix Definitions/ObjectModels/Validation/CountEqualTo.cs: Add [DynamicallyAccessedMembers]
  • Fix Definitions/Web/ClientHelpers.cs: Add [RequiresUnreferencedCode]
  • Fix Gui/ViewModels: Suppress BindingList and DataAnnotations IL2026 warnings
Original prompt

This section details on the original issue you should resolve

<issue_title>Enable PublishTrimmed compile option</issue_title>
<issue_description>Using -p:PublishTrimmed=true in dotnet publish would greatly reduce the binary size of the application, however enabling this option currently generates compile-errors around JSON and AOT. These errors should be resolved so we can use PulishTrimmed.</issue_description>

Comments on the Issue (you are @copilot in this section)


📱 Kick off Copilot coding agent tasks wherever you are with GitHub Mobile, available on iOS and Android.

Co-authored-by: LeftofZen <7483209+LeftofZen@users.noreply.github.com>
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.

Enable PublishTrimmed compile option

2 participants