7 ms·
> If you want a single-file exe that's a bit more advanced and requires a few properties in the csproj. This. This is what's wrong. Why is single-file exe "a b
by dmitriid 5y ago
> If you want a single-file exe that's a bit more advanced and requires a few properties in the csproj.
This. This is what's wrong. Why is single-file exe "a bit more advanced". In early 2000s Delphi could build a single file exe in seconds, and that was the default behaviour.
What changed since early 2000s that having an exe is a) advanced and b) requires manually fiddling with some unspecified properties in the abomination that is a csproj file?
- Dayshine 5y agoEmbedding native assemblies inside another application is apparently very hard. I'm not sure I know any frameworks that easily support arbitrary native .dll/.so inside the application executable.
- oblio 5y agohttps://www.joelonsoftware.com/2004/01/28/please-sir-may-i-have-a-linker/ https://www.joelonsoftware.com/2004/01/28/please-sir-may-i-h... Strategic decision from Sun and Microsoft that has crippled software for 2 decades already.
- xyzzy_plugh 5y agoThe rest of the world refers to this as "static linking" and it is, in fact, trivial.
- julik 5y agoIt is trivial if you can embed most of the OS inside of your executable, if there can be only 1 version of the OS, if you do not use any libraries you cannot statically link and so on.
- 6nf 5y agoIt's amazing that most people on this thread seems to take this nonsense as being completely normal and acceptable now. It really shows how much windows dev has devolved over the last decade.
- Dayshine 5y agoWhy does every linux app I download come as a self-extracting installer, run in a container, or download dependencies? Those aren't single-file executables.
- oblio 5y agoThe discussion was about Windows, which offers self contained apps and where the support matrix isn't the size of Asia.
- Dayshine 5y agoWhich dotnet supports with a single compile parameter, I'm not sure why people are making it out as if this is some very complicated feature.
- dmitriid 5y ago> I'm not sure why people are making it out as if this is some very complicated feature. OP asked how. The answer was, quote "If you want a single-file exe (as in completely statically compiled without self-extraction) that's a bit more advanced and requires a few properties in the csproj to configure how to handle native assemblies that expect to exist on disk. If you want it to have no runtime dependencies, add `--self-contained`" Somehow creating an exe is "more advanced", and requires changing of unspecified parameters in the project file. wat.
- Dayshine 5y agoHuh? `dotnet run` created an .exe. I'm talking about creating a single-file application, which is just an end-user nice-to-have if you aren't using an installer or deployment system. Don't most applications have a bunch of ancillary files? I rarely see installed applications on any platform that are a single file.
- jodrellblank 5y ago
- mumblemumble 5y ago> This. This is what's wrong. Why is single-file exe "a bit more advanced". Because that's how it works for very every single interpreted and bytecode compiled language? And the thing that changed in the early 2000s was a massive shift toward using interpreted and bytecode compiled languages. If we're specifically talking .NET, the thing that changed since the early 2000s is that creating a self-contained executable became possible in the first place. On Windows, .NET *.exe files were still run by an outside runtime, it's just that, since Microsoft owned the whole platform, it was easy for them to hide all that behind a curtain, ensure .NET is preinstalled with Windows, etc. The design constraints changed when .NET became cross-platform. OS X and Linux require a bit more (or at least different) finagling in order to achieve good user experience.
- deleted 5y ago[deleted]
- svnpenn 5y agoWhich is exactly why I dont use any of those. I will stick to Go, or Rust, or Zig. People expect to be able to produce a single EXE. Maybe not as the default, but it should be an option, and an easy option. Any language that cant do that is a failure in my opinion. Also please dont lump interpreted languages with C#. At least with interpreted languages, once you have the runtime on your computer, you can have a single script file to work with. With C#, you STILL have to have the runtime on your computer, then after you "compile", youre left with a folder of one EXE and literally over 100 DLL.
- Dayshine 5y ago> With C#, you STILL have to have the runtime on your computer, then after you "compile", youre left with a folder of one EXE and literally over 100 DLL. No you don't. If you'd rather increase the download size for the user then you can turn on self-contained (include runtime) and single-file app.
- MikusR 5y agoThat single-file app is a zip archive with exe and those dlls
- oblio 5y agohttps://www.joelonsoftware.com/2004/01/28/please-sir-may-i-have-a-linker/ https://www.joelonsoftware.com/2004/01/28/please-sir-may-i-h... Short story: developer interests unfortunately don't always align with tool builder interests.
- anaisbetts 5y agoDo you know of any production GUI applications that are literally a single-file EXE and aren't like, small utilities? There's just no reason to try to pack everything into a single file, Go-style. The self-contained publish (which is literally a single flag) is a quite reasonable result - a directory of files that are completely sufficient to run your app on any Windows computer, without any dependencies to install.
- mwcampbell 5y ago> Do you know of any production GUI applications that are literally a single-file EXE and aren't like, small utilities? The old Delphi-based version of Skype fell into that category. Thinking of that example, I can understand why some people think modern software is decadent.
- NicoJuicy 5y agoEg. Every .exe has an accompagning .config file. It's really easy/simple to change an application to adjust for a different client this way.
- scott00 5y agoThe reason it's more complicated is to support reflection. C# allows you to create objects and call methods at runtime based on data not available at compile time, including classes and methods that don't get used by the normal (non-reflection) code. That means that by default you can't do tree shaking, which means you would end up with enormous exes, which will probably annoy the type of people who want a single exe. The bit more advanced is to tell the compiler which types you might want to reference by reflection so that it can shake the rest out of the tree.
- sixothree 5y agoAnd what. You’re going to run .exe files on Linux?? Lol.