-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable trimming #4
Labels
enhancement
New feature or request
Comments
Early test shows upto 50% reduction (50mb -> 25mb) with the following Default.md file: <!--<Assembly Name="*Application*" Dynamic="Required All" />-->
<!-- .NET Native fix -->
<Assembly Dynamic="Required All" Name="NLog"/>
<Assembly Dynamic="Required All" Name="Microsoft.Extensions.DependencyInjection"/>
<Assembly Dynamic="Required All" Name="Microsoft.Extensions.Options"/>
<Assembly Dynamic="Required All" Name="Microsoft.Extensions.Logging"/>
<Assembly Dynamic="Required All" Name="Microsoft.Extensions.Http"/> Problem is serializers returning null due to reflection, will need to rewrite using source generator: I was suggested to use Sample: [JsonSourceGenerationOptions(PropertyNameCaseInsensitive = true)]
[JsonSerializable(typeof(AirQuality), GenerationMode = JsonSourceGenerationMode.Metadata)]
internal partial class MyJsonContext : JsonSerializerContext
{
}
..
await JsonSerializer.DeserializeAsync(stream, MyJsonContext.Default.AirQuality); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
From Default.rd.xml remove:
<Assembly Name="Application" Dynamic="Required All" />
Have to rewrite using DI source generator:
CommunityToolkit/Labs-Windows#463
Other MSBuild options you can set in your .csproj/.props to save size:
First one should save ~8% of binary size
Second one can save a few hundred KBs
(this is all per CPU arch)
The text was updated successfully, but these errors were encountered: