Skip to content

Commit

Permalink
Set partial trimming (#265)
Browse files Browse the repository at this point in the history
### Why

The published build of bmx right now will crash with the error `No
parameterless constructor defined for type
'Amazon.Util.Internal.PlatformServices.NetworkReachability'`


https://learn.microsoft.com/en-us/dotnet/core/deploying/trimming/trim-self-contained

When building bmx with aot, we reduce the deployment size by getting rid
of unused parts of libraries. Theres a [problem
](aws/aws-sdk-net#2531) though with the aws
sdk right now where it gets rid of some parts we actually need. I think
it's to do with
[this](https://learn.microsoft.com/en-us/dotnet/core/deploying/trimming/incompatibilities#dynamic-assembly-loading-and-execution)

### How

The github issue page mentioned a temporary solution to set the trim
mode to partial for now. The build size would be 17.5MB compared to 13
so it seems like not a big issue?
  • Loading branch information
gord5500 authored May 2, 2023
1 parent 8d10a05 commit 32e1eb4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/D2L.Bmx/D2L.Bmx.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetName>bmx</TargetName>
Expand All @@ -8,6 +8,7 @@
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<WarningsAsErrors>nullable</WarningsAsErrors>
<TrimMode>partial</TrimMode>
</PropertyGroup>

<ItemGroup>
Expand Down

0 comments on commit 32e1eb4

Please sign in to comment.