4 ms·
Man, as a C# dev, I'd kill for a single exe output. The binary being only 40MB is an absolute fantasy. We have a project at work, it's nothing crazy, mostly sh
by utensil4778 2y ago
Man, as a C# dev, I'd kill for a single exe output. The binary being only 40MB is an absolute fantasy.
We have a project at work, it's nothing crazy, mostly shuffling data from one pipe to another, maybe a few thousand lines of code. A true standalone build including dotnet is over 180MB. The build that relies on the system dotnet install is still over 50MB. It's not even a GUI, it's a background service.
Things on Windows have a bad habit of enormous binary bloat, I'm not sure why. I don't think the problem is near as bad on Linux in general, but I don't have enough experience with linux dev to really say
- neonsunset 2y agoThis has been solved since .NET 6/7 and the results should pleasantly surprise you: - https://learn.microsoft.com/en-us/dotnet/core/deploying/single-file/overview https://learn.microsoft.com/en-us/dotnet/core/deploying/sing... - https://learn.microsoft.com/en-us/dotnet/core/deploying/trimming/trim-self-contained https://learn.microsoft.com/en-us/dotnet/core/deploying/trim... Alternatively, you could try the following first (use .NET 8 SDK): dotnet publish -o out -p:PublishSingleFile=true -p:PublishTrimmed=true Also, I just tried worker template (it includes generic host, DI, logger, etc.) and it's only 5 MiB when AOT compiled on macOS: dotnet new worker --aot dotnet publish -o out Will likely take less on Windows and Linux.
- wordofx 2y agoYou already have that as a .net dev. I deploy my asp.net site to Linux by building it as a self contained single file. Deploy services. Have a couple of WPF apps both self contained single file. They all end up around 43-85mb. The services are smaller when trimming is applied at around 30mb. Not a single project has ended up over 100mb but I can see that happening if you have a ton of nuget packages.