Heh … Lots of systems do that sort of thing, although they’re usually generating object-code not source so you don’t so-readily see it. Back in the day, I tried very hard to get Delphi to produce a “command-line hello-world program” that was smaller than a couple megabytes but never succeeded.
But it’s okay, of course, because you don’t use Delphi to produce “command-line hello-world programs.” When you start building the kind of stuff that the tool was made for, the foundational code that it adds in will probably be used. “Minimizing output file-size” is not a significant design consideration, within reason, as long as it works.
(And of course, the C# compiler might “optimize away” a lot of the cruft as it generates a final binary.)