You can, but startup times, binary size, memory usage, … are all very exciting compared to programs you build with C/C++, Go or Rust. All of this is entirely possible for server applications, but Microsoft is also targeting it for IOT devices and I think they’re really struggling there.
.NET just doesn’t do trimming well, because of the previous options (eg mirroring). The ability to load assemblies dynamically, and to call functions dynamically (eg ASP.NET consoles) makes this very difficult. Despite many promises, it’s still very exciting and I don’t expect it to really work unless MS wants to break with the past.
Meanwhile, the .NET era is starting to hurt a bit. See how non-nullable types are implemented. Instead of the original type, it is invented using annotations (attributes). All this causes misery. All calls from outside your assembly should be checked with a non-nullable type.
I’ve been working with .NET since version 1.0 (think about 20 years ago), but since a few years I’ve also been programming with Go and Rust. Then you will suddenly see the shortcomings of much better .NET. I can recommend it to every programmer to broaden his horizons. Don’t keep doing everything in .NET (I used to do that too), but look no further.
“Lifelong zombie fanatic. Hardcore web practitioner. Thinker. Music expert. Unapologetic pop culture scholar.”