Skip to content

Conversation

zrckr
Copy link
Contributor

@zrckr zrckr commented Sep 20, 2025

Ok, this is a big one...

For more convenient development of current and future commands for the CLI, I suggest using the System.CommandLine library. This is used for the dotnet utility and provides an API for creating CLIs. It is currently in the rc stage, but its API is quite stable.

Advantages:

  • Supports many native C# types that automatically convert data (for example, enums, file and directory infos).
  • No reflection-based API.
  • Quite small (~153 KB) and no external dependencies.

Disadvantages:

  • The library currently is in preview stage (mentioned above).
  • Microsoft's documentation is still sparse, describing only the basic principles of working with the library.

For now this PR is adraft because it contains many changes. In terms of functionality, (almost) everything has remained the same (except for the help command, which is generated by the library).

A self-contained executable is compiling without errors. The only thing is that the library warns about being tailored for .NET 8.0, but (so far) it compiles fine under .NET 6.0.

Link to the documentation: System.CommandLine overview

@Krzyhau
Copy link
Member

Krzyhau commented Sep 20, 2025

Out of curiosity, how much would it hurt us to retarget Repacker CLI to .NET 8.0?

@zrckr
Copy link
Contributor Author

zrckr commented Sep 22, 2025

I ran an experiment with two SDKs (changed the target framework on FEZRepacker.Interface and FEZRepacker.Tests).
Command used: dotnet publish -c Release -r win-x86 --self-contained

SDK 8.0.414, TargetFramework net8.0:

  Determining projects to restore...
D:\Source\fez-repacker\Core\FEZRepacker.Core.csproj : warning NU1902: Package 'SixLabors.ImageSharp' 2.1.10 has a known moderate severity vulnerability, https://github.com/advisories/GHSA-rxmq-m78w-7wmc [D:\Source\fez-repacker\FEZRepacker.sln]
  Restored D:\Source\fez-repacker\Core\FEZRepacker.Core.csproj (in 218 ms).
  2 of 3 projects are up-to-date for restore.
D:\Source\fez-repacker\Core\FEZRepacker.Core.csproj : warning NU1902: Package 'SixLabors.ImageSharp' 2.1.10 has a known moderate severity vulnerability, https://github.com/advisories/GHSA-rxmq-m78w-7wmc
D:\Source\fez-repacker\Core\FEZRepacker.Core.csproj : warning NU1902: Package 'SixLabors.ImageSharp' 2.1.10 has a known moderate severity vulnerability, https://github.com/advisories/GHSA-rxmq-m78w-7wmc
  FEZRepacker.Core -> D:\Source\fez-repacker\Core\bin\Release\netstandard2.0\FEZRepacker.Core.dll
D:\Source\fez-repacker\Core\FEZRepacker.Core.csproj : warning NU1902: Package 'SixLabors.ImageSharp' 2.1.10 has a known moderate severity vulnerability, https://github.com/advisories/GHSA-rxmq-m78w-7wmc
  The package FEZRepacker.Core.1.1.2 is missing a readme. Go to https://aka.ms/nuget/authoring-best-practices/readme to learn why package readmes are important.
  Successfully created package 'D:\Source\fez-repacker\Core\bin\Release\FEZRepacker.Core.1.1.2.nupkg'.
D:\Source\fez-repacker\Interface\CommandLineUtils.cs(26,34): warning IL2090: 'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicConstructors', 'DynamicallyAccessedMemberTypes.PublicMethods', 'DynamicallyAccessedMemberTypes.PublicFields', 'DynamicallyAccessedMemberTypes.PublicNestedTypes', 'DynamicallyAccessedMemberTypes.PublicProperties', 'DynamicallyAccessedMemberTypes.PublicEvents' in call to 'System.Type.GetMember(String)'. The generic parameter 'T' of 'FEZRepacker.Interface.CommandLineUtils.CustomAliasedEnumParser<T>(ArgumentResult)' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to. [D:\Source\fez-repacker\Interface\FEZRepacker.Interface.csproj]
  FEZRepacker.Core -> D:\Source\fez-repacker\Core\bin\Release\netstandard2.0\win-x86\FEZRepacker.Core.dll
  FEZRepacker.Interface -> D:\Source\fez-repacker\Interface\bin\Release\net8.0\win-x86\FEZRepacker.dll
D:\Source\fez-repacker\Core\FEZRepacker.Core.csproj : warning NU1902: Package 'SixLabors.ImageSharp' 2.1.10 has a known moderate severity vulnerability, https://github.com/advisories/GHSA-rxmq-m78w-7wmc
  Optimizing assemblies for size. This process might take a while.
  The package FEZRepacker.Core.1.1.2 is missing a readme. Go to https://aka.ms/nuget/authoring-best-practices/readme to learn why package readmes are important.
  Successfully created package 'D:\Source\fez-repacker\Core\bin\Release\FEZRepacker.Core.1.1.2.nupkg'.
  FEZRepacker.Core -> D:\Source\fez-repacker\Core\bin\Release\netstandard2.0\win-x86\publish\
D:\Source\fez-repacker\Interface\CommandLineUtils.cs(54,13): Trim analysis warning IL2075: FEZRepacker.Interface.CommandLineUtils.ArgumentsOf(Enum): 'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicConstructors', 'DynamicallyAccessedMemberTypes.PublicMethods', 'DynamicallyAccessedMemberTypes.PublicFields', 'DynamicallyAccessedMemberTypes.PublicNestedTypes', 'DynamicallyAccessedMemberTypes.PublicProperties', 'DynamicallyAccessedMemberTypes.PublicEvents' in call to 'System.Type.GetMember(String)'. The return value of method 'System.Object.GetType()' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to. [D:\Source\fez-repacker\Interface\FEZRepacker.Interface.csproj]
D:\Source\fez-repacker\Interface\CommandLineUtils.cs(26,17): Trim analysis warning IL2090: FEZRepacker.Interface.CommandLineUtils.CustomAliasedEnumParser<T>(ArgumentResult): 'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicConstructors', 'DynamicallyAccessedMemberTypes.PublicMethods', 'DynamicallyAccessedMemberTypes.PublicFields', 'DynamicallyAccessedMemberTypes.PublicNestedTypes', 'DynamicallyAccessedMemberTypes.PublicProperties', 'DynamicallyAccessedMemberTypes.PublicEvents' in call to 'System.Type.GetMember(String)'. The generic parameter 'T' of 'FEZRepacker.Interface.CommandLineUtils.CustomAliasedEnumParser<T>(ArgumentResult)' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to. [D:\Source\fez-repacker\Interface\FEZRepacker.Interface.csproj]
D:\Source\fez-repacker\Core\Helpers\Json\CustomConverters\ColorJsonConverter.cs(18,13): Trim analysis warning IL2026: FEZRepacker.Core.Helpers.Json.CustomConverters.ColorJsonConverter.Read(Utf8JsonReader&, Type, JsonSerializerOptions): Using member 'System.Text.Json.JsonSerializer.Deserialize<TValue>(JsonDocument, JsonSerializerOptions)' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved. [D:\Source\fez-repacker\Interface\FEZRepacker.Interface.csproj]
D:\Source\fez-repacker\Core\Helpers\Json\ConfiguredJsonSerializer.cs(27,13): Trim analysis warning IL2026: FEZRepacker.Core.Helpers.Json.ConfiguredJsonSerializer.Deserialize<T>(String): Using member 'System.Text.Json.JsonSerializer.Deserialize<TValue>(String, JsonSerializerOptions)' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved. [D:\Source\fez-repacker\Interface\FEZRepacker.Interface.csproj]
D:\Source\fez-repacker\Core\Helpers\Json\ConfiguredJsonSerializer.cs(59,13): Trim analysis warning IL2026: FEZRepacker.Core.Helpers.Json.ConfiguredJsonSerializer.DeserializeFromNode<T>(JsonNode): Using member 'System.Text.Json.JsonSerializer.Deserialize<TValue>(JsonNode, JsonSerializerOptions)' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved. [D:\Source\fez-repacker\Interface\FEZRepacker.Interface.csproj]
D:\Source\fez-repacker\Core\Helpers\Json\ConfiguredJsonSerializer.cs(22,13): Trim analysis warning IL2026: FEZRepacker.Core.Helpers.Json.ConfiguredJsonSerializer.Serialize<T>(T): Using member 'System.Text.Json.JsonSerializer.Serialize<TValue>(TValue, JsonSerializerOptions)' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved. [D:\Source\fez-repacker\Interface\FEZRepacker.Interface.csproj]
D:\Source\fez-repacker\Core\Helpers\Json\ConfiguredJsonSerializer.cs(54,13): Trim analysis warning IL2026: FEZRepacker.Core.Helpers.Json.ConfiguredJsonSerializer.SerializeToNode<T>(T): Using member 'System.Text.Json.JsonSerializer.SerializeToNode<TValue>(TValue, JsonSerializerOptions)' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved. [D:\Source\fez-repacker\Interface\FEZRepacker.Interface.csproj]
D:\Source\fez-repacker\Core\XNB\ContentSerialization\GenericContentSerializer.cs(53,13): Trim analysis warning IL2087: FEZRepacker.Core.XNB.ContentSerialization.GenericContentSerializer<T>.CreateContainedTypeConstructor(): 'type' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicParameterlessConstructor' in call to 'System.Linq.Expressions.Expression.New(Type)'. The generic parameter 'T' of 'FEZRepacker.Core.XNB.ContentSerialization.GenericContentSerializer<T>' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to. [D:\Source\fez-repacker\Interface\FEZRepacker.Interface.csproj]
D:\Source\fez-repacker\Core\XNB\ContentSerialization\GenericContentSerializer.cs(36,13): Trim analysis warning IL2090: FEZRepacker.Core.XNB.ContentSerialization.GenericContentSerializer<T>.PopulateReflectionMaps(): 'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicProperties' in call to 'System.Type.GetProperties()'. The generic parameter 'T' of 'FEZRepacker.Core.XNB.ContentSerialization.GenericContentSerializer<T>' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to. [D:\Source\fez-repacker\Interface\FEZRepacker.Interface.csproj]
ILLink : Trim analysis warning IL2026: SharpGLTF.Schema2.ExtraProperties.Extras.get: Using member 'System.Text.Json.Nodes.JsonNode.ConvertFromValue<T>(T, Nullable<JsonNodeOptions>)' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved. [D:\Source\fez-repacker\Interface\FEZRepacker.Interface.csproj]
ILLink : Trim analysis warning IL2026: SharpGLTF.Schema2.ExtraProperties.Extras.get: Using member 'System.Text.Json.Nodes.JsonNode.ReplaceWith<T>(T)' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. Creating JsonValue instances with non-primitive types is not compatible with trimming. It can result in non-primitive types being serialized, which may have their members trimmed. [D:\Source\fez-repacker\Interface\FEZRepacker.Interface.csproj]
ILLink : Trim analysis warning IL2026: SharpGLTF.Schema2.ExtraProperties.Extras.get: Using member 'System.Text.Json.Nodes.JsonNode.ConvertFromValue<T>(T, Nullable<JsonNodeOptions>)' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved. [D:\Source\fez-repacker\Interface\FEZRepacker.Interface.csproj]
ILLink : Trim analysis warning IL2026: SharpGLTF.Schema2.ExtraProperties.Extras.get: Using member 'System.Text.Json.Nodes.JsonValue.Create<T>(T, Nullable<JsonNodeOptions>)' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. Creating JsonValue instances with non-primitive types is not compatible with trimming. It can result in non-primitive types being serialized, which may have their members trimmed. Use the overload that takes a JsonTypeInfo, or make sure all of the required types are preserved. [D:\Source\fez-repacker\Interface\FEZRepacker.Interface.csproj]
ILLink : Trim analysis warning IL2026: SharpGLTF.Schema2.ExtraProperties.Extras.get: Using member 'System.Text.Json.Nodes.JsonNode.ReplaceWith<T>(T)' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. Creating JsonValue instances with non-primitive types is not compatible with trimming. It can result in non-primitive types being serialized, which may have their members trimmed. [D:\Source\fez-repacker\Interface\FEZRepacker.Interface.csproj]
ILLink : Trim analysis warning IL2026: SharpGLTF.Schema2.ExtraProperties.Extras.get: Using member 'System.Text.Json.Nodes.JsonNode.ConvertFromValue<T>(T, Nullable<JsonNodeOptions>)' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved. [D:\Source\fez-repacker\Interface\FEZRepacker.Interface.csproj]
ILLink : Trim analysis warning IL2026: SharpGLTF.Schema2.ExtraProperties.Extras.get: Using member 'System.Text.Json.Nodes.JsonNode.ReplaceWith<T>(T)' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. Creating JsonValue instances with non-primitive types is not compatible with trimming. It can result in non-primitive types being serialized, which may have their members trimmed. [D:\Source\fez-repacker\Interface\FEZRepacker.Interface.csproj]
ILLink : Trim analysis warning IL2026: SharpGLTF.Schema2.ExtraProperties.Extras.get: Using member 'System.Text.Json.Nodes.JsonArray.Add<T>(T)' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. Creating JsonValue instances with non-primitive types is not compatible with trimming. It can result in non-primitive types being serialized, which may have their members trimmed. [D:\Source\fez-repacker\Interface\FEZRepacker.Interface.csproj]
ILLink : Trim analysis warning IL2026: SharpGLTF.Schema2.ExtraProperties.Extras.set: Using member 'System.Text.Json.Nodes.JsonNode.ConvertFromValue<T>(T, Nullable<JsonNodeOptions>)' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved. [D:\Source\fez-repacker\Interface\FEZRepacker.Interface.csproj]
ILLink : Trim analysis warning IL2026: SharpGLTF.Schema2.ExtraProperties.Extras.set: Using member 'System.Text.Json.Nodes.JsonNode.ReplaceWith<T>(T)' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. Creating JsonValue instances with non-primitive types is not compatible with trimming. It can result in non-primitive types being serialized, which may have their members trimmed. [D:\Source\fez-repacker\Interface\FEZRepacker.Interface.csproj]
ILLink : Trim analysis warning IL2026: SharpGLTF.Schema2.ExtraProperties.Extras.set: Using member 'System.Text.Json.Nodes.JsonNode.ConvertFromValue<T>(T, Nullable<JsonNodeOptions>)' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved. [D:\Source\fez-repacker\Interface\FEZRepacker.Interface.csproj]
ILLink : Trim analysis warning IL2026: SharpGLTF.Schema2.ExtraProperties.Extras.set: Using member 'System.Text.Json.Nodes.JsonArray.Add<T>(T)' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. Creating JsonValue instances with non-primitive types is not compatible with trimming. It can result in non-primitive types being serialized, which may have their members trimmed. [D:\Source\fez-repacker\Interface\FEZRepacker.Interface.csproj]
ILLink : Trim analysis warning IL2026: SharpGLTF.Schema2.ExtraProperties.Extras.set: Using member 'System.Text.Json.Nodes.JsonNode.ReplaceWith<T>(T)' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. Creating JsonValue instances with non-primitive types is not compatible with trimming. It can result in non-primitive types being serialized, which may have their members trimmed. [D:\Source\fez-repacker\Interface\FEZRepacker.Interface.csproj]
ILLink : Trim analysis warning IL2026: SharpGLTF.Schema2.ExtraProperties.Extras.set: Using member 'System.Text.Json.Nodes.JsonNode.ReplaceWith<T>(T)' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. Creating JsonValue instances with non-primitive types is not compatible with trimming. It can result in non-primitive types being serialized, which may have their members trimmed. [D:\Source\fez-repacker\Interface\FEZRepacker.Interface.csproj]
ILLink : Trim analysis warning IL2026: SharpGLTF.Schema2.ExtraProperties.Extras.set: Using member 'System.Text.Json.Nodes.JsonNode.ConvertFromValue<T>(T, Nullable<JsonNodeOptions>)' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved. [D:\Source\fez-repacker\Interface\FEZRepacker.Interface.csproj]
ILLink : Trim analysis warning IL2026: SharpGLTF.Schema2.ExtraProperties.Extras.set: Using member 'System.Text.Json.Nodes.JsonValue.Create<T>(T, Nullable<JsonNodeOptions>)' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. Creating JsonValue instances with non-primitive types is not compatible with trimming. It can result in non-primitive types being serialized, which may have their members trimmed. Use the overload that takes a JsonTypeInfo, or make sure all of the required types are preserved. [D:\Source\fez-repacker\Interface\FEZRepacker.Interface.csproj]
ILLink : Trim analysis warning IL2026: SharpGLTF.IO.UnknownNode._Properties: Using member 'System.Text.Json.Nodes.JsonNode.ConvertFromValue<T>(T, Nullable<JsonNodeOptions>)' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved. [D:\Source\fez-repacker\Interface\FEZRepacker.Interface.csproj]
ILLink : Trim analysis warning IL2026: SharpGLTF.IO.UnknownNode._Properties: Using member 'System.Text.Json.Nodes.JsonNode.ReplaceWith<T>(T)' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. Creating JsonValue instances with non-primitive types is not compatible with trimming. It can result in non-primitive types being serialized, which may have their members trimmed. [D:\Source\fez-repacker\Interface\FEZRepacker.Interface.csproj]
ILLink : Trim analysis warning IL2026: SharpGLTF.IO.UnknownNode._Properties: Using member 'System.Text.Json.Nodes.JsonValue.Create<T>(T, Nullable<JsonNodeOptions>)' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. Creating JsonValue instances with non-primitive types is not compatible with trimming. It can result in non-primitive types being serialized, which may have their members trimmed. Use the overload that takes a JsonTypeInfo, or make sure all of the required types are preserved. [D:\Source\fez-repacker\Interface\FEZRepacker.Interface.csproj]
ILLink : Trim analysis warning IL2026: SharpGLTF.IO.UnknownNode._Properties: Using member 'System.Text.Json.Nodes.JsonNode.ConvertFromValue<T>(T, Nullable<JsonNodeOptions>)' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved. [D:\Source\fez-repacker\Interface\FEZRepacker.Interface.csproj]
ILLink : Trim analysis warning IL2026: SharpGLTF.IO.UnknownNode._Properties: Using member 'System.Text.Json.Nodes.JsonNode.ReplaceWith<T>(T)' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. Creating JsonValue instances with non-primitive types is not compatible with trimming. It can result in non-primitive types being serialized, which may have their members trimmed. [D:\Source\fez-repacker\Interface\FEZRepacker.Interface.csproj]
ILLink : Trim analysis warning IL2026: SharpGLTF.IO.UnknownNode._Properties: Using member 'System.Text.Json.Nodes.JsonArray.Add<T>(T)' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. Creating JsonValue instances with non-primitive types is not compatible with trimming. It can result in non-primitive types being serialized, which may have their members trimmed. [D:\Source\fez-repacker\Interface\FEZRepacker.Interface.csproj]
ILLink : Trim analysis warning IL2026: SharpGLTF.IO.UnknownNode._Properties: Using member 'System.Text.Json.Nodes.JsonNode.ConvertFromValue<T>(T, Nullable<JsonNodeOptions>)' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved. [D:\Source\fez-repacker\Interface\FEZRepacker.Interface.csproj]
ILLink : Trim analysis warning IL2026: SharpGLTF.IO.UnknownNode._Properties: Using member 'System.Text.Json.Nodes.JsonNode.ReplaceWith<T>(T)' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. Creating JsonValue instances with non-primitive types is not compatible with trimming. It can result in non-primitive types being serialized, which may have their members trimmed. [D:\Source\fez-repacker\Interface\FEZRepacker.Interface.csproj]
ILLink : Trim analysis warning IL2026: SharpGLTF.IO.UnknownNode.DeserializeProperty(String, Utf8JsonReader&): Using member 'System.Text.Json.Nodes.JsonNode.ReplaceWith<T>(T)' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. Creating JsonValue instances with non-primitive types is not compatible with trimming. It can result in non-primitive types being serialized, which may have their members trimmed. [D:\Source\fez-repacker\Interface\FEZRepacker.Interface.csproj]
ILLink : Trim analysis warning IL2026: SharpGLTF.IO.UnknownNode.DeserializeProperty(String, Utf8JsonReader&): Using member 'System.Text.Json.Nodes.JsonValue.Create<T>(T, Nullable<JsonNodeOptions>)' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. Creating JsonValue instances with non-primitive types is not compatible with trimming. It can result in non-primitive types being serialized, which may have their members trimmed. Use the overload that takes a JsonTypeInfo, or make sure all of the required types are preserved. [D:\Source\fez-repacker\Interface\FEZRepacker.Interface.csproj]
ILLink : Trim analysis warning IL2026: SharpGLTF.IO.UnknownNode.DeserializeProperty(String, Utf8JsonReader&): Using member 'System.Text.Json.Nodes.JsonNode.ConvertFromValue<T>(T, Nullable<JsonNodeOptions>)' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved. [D:\Source\fez-repacker\Interface\FEZRepacker.Interface.csproj]
ILLink : Trim analysis warning IL2026: SharpGLTF.IO.UnknownNode.DeserializeProperty(String, Utf8JsonReader&): Using member 'System.Text.Json.Nodes.JsonNode.ReplaceWith<T>(T)' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. Creating JsonValue instances with non-primitive types is not compatible with trimming. It can result in non-primitive types being serialized, which may have their members trimmed. [D:\Source\fez-repacker\Interface\FEZRepacker.Interface.csproj]
ILLink : Trim analysis warning IL2026: SharpGLTF.IO.UnknownNode.DeserializeProperty(String, Utf8JsonReader&): Using member 'System.Text.Json.Nodes.JsonArray.Add<T>(T)' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. Creating JsonValue instances with non-primitive types is not compatible with trimming. It can result in non-primitive types being serialized, which may have their members trimmed. [D:\Source\fez-repacker\Interface\FEZRepacker.Interface.csproj]
ILLink : Trim analysis warning IL2026: SharpGLTF.IO.UnknownNode.DeserializeProperty(String, Utf8JsonReader&): Using member 'System.Text.Json.Nodes.JsonNode.ConvertFromValue<T>(T, Nullable<JsonNodeOptions>)' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved. [D:\Source\fez-repacker\Interface\FEZRepacker.Interface.csproj]
ILLink : Trim analysis warning IL2026: SharpGLTF.IO.UnknownNode.DeserializeProperty(String, Utf8JsonReader&): Using member 'System.Text.Json.Nodes.JsonNode.ReplaceWith<T>(T)' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. Creating JsonValue instances with non-primitive types is not compatible with trimming. It can result in non-primitive types being serialized, which may have their members trimmed. [D:\Source\fez-repacker\Interface\FEZRepacker.Interface.csproj]
ILLink : Trim analysis warning IL2026: SharpGLTF.IO.UnknownNode.DeserializeProperty(String, Utf8JsonReader&): Using member 'System.Text.Json.Nodes.JsonNode.ConvertFromValue<T>(T, Nullable<JsonNodeOptions>)' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved. [D:\Source\fez-repacker\Interface\FEZRepacker.Interface.csproj]
C:\Users\User\.nuget\packages\sharpgltf.core\1.0.4\lib\net8.0\SharpGLTF.Core.dll : warning IL2104: Assembly 'SharpGLTF.Core' produced trim warnings. For more information see https://aka.ms/dotnet-illink/libraries [D:\Source\fez-repacker\Interface\FEZRepacker.Interface.csproj]
C:\Users\User\.nuget\packages\sharpgltf.toolkit\1.0.4\lib\net8.0\SharpGLTF.Toolkit.dll : warning IL2104: Assembly 'SharpGLTF.Toolkit' produced trim warnings. For more information see https://aka.ms/dotnet-illink/libraries [D:\Source\fez-repacker\Interface\FEZRepacker.Interface.csproj]
C:\Users\User\.nuget\packages\sixlabors.imagesharp\2.1.10\lib\netcoreapp3.1\SixLabors.ImageSharp.dll : warning IL2104: Assembly 'SixLabors.ImageSharp' produced trim warnings. For more information see https://aka.ms/dotnet-illink/libraries [D:\Source\fez-repacker\Interface\FEZRepacker.Interface.csproj]
C:\Users\User\.nuget\packages\system.text.json\9.0.4\lib\net8.0\System.Text.Json.dll : warning IL2104: Assembly 'System.Text.Json' produced trim warnings. For more information see https://aka.ms/dotnet-illink/libraries [D:\Source\fez-repacker\Interface\FEZRepacker.Interface.csproj]
  FEZRepacker.Interface -> D:\Source\fez-repacker\Interface\bin\Release\net8.0\win-x86\publish\
D:\Source\fez-repacker\Tests\TestUtils.cs(25,20): warning CS8602: Dereference of a possibly null reference. [D:\Source\fez-repacker\Tests\FEZRepacker.Tests.csproj]
D:\Source\fez-repacker\Tests\TestUtils.cs(25,20): warning CS8603: Possible null reference return. [D:\Source\fez-repacker\Tests\FEZRepacker.Tests.csproj]
D:\Source\fez-repacker\Tests\TestUtils.cs(8,35): warning CS8618: Non-nullable field 'Context' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the field as nullable. [D:\Source\fez-repacker\Tests\FEZRepacker.Tests.csproj]
  FEZRepacker.Tests -> D:\Source\fez-repacker\Tests\bin\Release\net8.0\win-x86\FEZRepacker.Tests.dll
  FEZRepacker.Tests -> D:\Source\fez-repacker\Tests\bin\Release\net8.0\win-x86\publish\

SDK 9.0.301, TargetFramework net9.0:

  Determining projects to restore...
D:\Source\fez-repacker\Core\FEZRepacker.Core.csproj : warning NU1902: Package 'SixLabors.ImageSharp' 2.1.10 has a known moderate severity vulnerability, https://github.com/advisories/GHSA-rxmq-m78w-7wmc [D:\Source\fez-repacker\FEZRepacker.sln]
  All projects are up-to-date for restore.
D:\Source\fez-repacker\Core\FEZRepacker.Core.csproj : warning NU1902: Package 'SixLabors.ImageSharp' 2.1.10 has a known moderate severity vulnerability, https://github.com/advisories/GHSA-rxmq-m78w-7wmc
  FEZRepacker.Core -> D:\Source\fez-repacker\Core\bin\Release\netstandard2.0\FEZRepacker.Core.dll
D:\Source\fez-repacker\Core\FEZRepacker.Core.csproj : warning NU1902: Package 'SixLabors.ImageSharp' 2.1.10 has a known moderate severity vulnerability, https://github.com/advisories/GHSA-rxmq-m78w-7wmc
D:\Source\fez-repacker\Core\FEZRepacker.Core.csproj : warning NU1902: Package 'SixLabors.ImageSharp' 2.1.10 has a known moderate severity vulnerability, https://github.com/advisories/GHSA-rxmq-m78w-7wmc
  FEZRepacker.Interface -> D:\Source\fez-repacker\Interface\bin\Release\net9.0\win-x86\FEZRepacker.dll
  FEZRepacker.Interface -> D:\Source\fez-repacker\Interface\bin\Release\net9.0\win-x86\publish\
  FEZRepacker.Core -> D:\Source\fez-repacker\Core\bin\Release\netstandard2.0\win-x86\FEZRepacker.Core.dll
  FEZRepacker.Tests -> D:\Source\fez-repacker\Tests\bin\Release\net9.0\win-x86\FEZRepacker.Tests.dll
D:\Source\fez-repacker\Core\FEZRepacker.Core.csproj : warning NU1902: Package 'SixLabors.ImageSharp' 2.1.10 has a known moderate severity vulnerability, https://github.com/advisories/GHSA-rxmq-m78w-7wmc
  FEZRepacker.Tests -> D:\Source\fez-repacker\Tests\bin\Release\net9.0\win-x86\publish\
  FEZRepacker.Core -> D:\Source\fez-repacker\Core\bin\Release\netstandard2.0\win-x86\publish\

@zrckr
Copy link
Contributor Author

zrckr commented Sep 22, 2025

It would make sense to aim for .NET 9.0 right away, bypassing the .NET 8.0, so that we can then upgrade to .NET 10.0 target (which will be LTS) if there will be no problems during the future transition.

@zrckr
Copy link
Contributor Author

zrckr commented Sep 22, 2025

On Release configuration on .NET 8.0 target and later breaking change occurred:
https://learn.microsoft.com/en-us/dotnet/core/compatibility/serialization/8.0/publishtrimmed

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.

2 participants