Making DOS / Win 3.11 / Win 9x apps with visual studio
Posted: Thu Nov 05, 2020 8:38 am
I just came across this. I was asked to make my Visual Studio console apps into a single EXE file and I figured, yeah, that should be possible and would be pretty useful. So I looked into it and to my surprise its only rather recently that it had become possible to do this. Using .Net Core 3.x, which is less than a year old. I think its even less than 2 years old even if you count the beta and it was a feature they added to .Net Core 3, it did not have it at the beginning.
These EXE files are called self-contained EXE files, and they have a trim option, so they contain the .Net Core runtime itself and all the DLLs and such. So I though... does that mean it might even run under DOS or will it still require Windows? I googled and found I was not the only one to have thought about this, someone had already done it and succeeded. Normally these self-contained EXE files would be at least 28MB because they contain everything, and that is even if you use a trimming feature. But he manages to bring a compiled EXE down to 27kb!
I can probably not replicate that, but I think I will try just for the fun of it. Here is a link to the article:
https://www.hanselman.com/blog/net-ever ... 11-and-dos
These EXE files are called self-contained EXE files, and they have a trim option, so they contain the .Net Core runtime itself and all the DLLs and such. So I though... does that mean it might even run under DOS or will it still require Windows? I googled and found I was not the only one to have thought about this, someone had already done it and succeeded. Normally these self-contained EXE files would be at least 28MB because they contain everything, and that is even if you use a trimming feature. But he manages to bring a compiled EXE down to 27kb!
I can probably not replicate that, but I think I will try just for the fun of it. Here is a link to the article:
https://www.hanselman.com/blog/net-ever ... 11-and-dos