SDot

9 posts

SDot

SDot

@ScottDotMS

-

Sydney, Australia Katılım Ekim 2015
109 Takip Edilen183 Takipçiler
SDot
SDot@ScottDotMS·
@jjoergensen @philiplaureano Great question! I'd have to do some digging to be honest for a per-dependency flag. There is an option for IlcTrimMetadata which will trim/remove: #options-related-to-metadata-generation" target="_blank" rel="nofollow noopener">github.com/dotnet/runtime…
English
1
0
0
0
Jonathan Jørgensen 💙💛
Jonathan Jørgensen 💙💛@jjoergensen·
@ScottDotMS @philiplaureano Can you do trimming/reflection different for specific libraries? Or is it the same config for the whole executable? So for exampld I can keep reflection for wpf but avoid for everything else?
English
3
0
0
0
SDot
SDot@ScottDotMS·
What a world! An ASP.NET Core Minimal API, running as a top-level statement on .NET 7.0, being AOT statically compiled into a container image (FROM scratch, no deps!), running without issue. (I'll save you the list of warnings, but details below...)
SDot tweet media
English
2
63
306
0
SDot
SDot@ScottDotMS·
@philiplaureano Adding in IlcDisableReflection breaks a lot of things :P
SDot tweet media
English
1
0
1
0
SDot
SDot@ScottDotMS·
@philiplaureano It does depend. In the example above I'm not going overboard with trimming, and I've commented out disabling reflection, so we can do some basic reflection. For example (shown below), we can list and invoke methods on a class, but there are definitely limitations!
SDot tweet media
English
1
0
0
0
SDot
SDot@ScottDotMS·
Now I personally wouldn't use this in production (who am I kidding, I totally would but I'd never recommend someone else should!), but it's a cool proof of concept for minimal containers and .NET Want to hear more? Have questions? Want to know why? Let me know!
English
1
0
11
0
SDot
SDot@ScottDotMS·
Finally at the bottom we have the running container and browser pointing to it. The app is a bit chunky for a "Hello, World!" API (coming in at 91.6MB), but that is everything, no extra layers or dependencies, just our app.
English
2
0
4
0