5 ms·
Yes, "dotnet publish" is what I was thinking of. Wow, I didn't realize it could cross-compile! I can't quite tell from the .NET SDK repository -- any idea if t
by schemescape 4y ago
Yes, "dotnet publish" is what I was thinking of. Wow, I didn't realize it could cross-compile!
I can't quite tell from the .NET SDK repository -- any idea if this stuff works on Linux (i.e. building on Linux, perhaps for Windows)? I see mention of MSBuild, so I'm guessing maybe not.
I love C#, but I abandoned it a while ago because I wanted to only rely on open source tools (just to ensure my code is usable in the future). Then, of course, they open-sourced a bunch of stuff (including the compiler). If I at least had the option to develop C# on Linux (with support for cross-compiling to Windows), that would be great (and honestly something I would have never expected 10 years ago).
- schemescape 4y agoActually, it does work from Linux! I just tried it and "dotnet publish --os win" cross-compiled from Linux to Windows. Nice!
- kcartlidge 4y ago> Actually, it does work from Linux ... cross-compiled from Linux to Windows. Here's a link to the commands I use to generate my cross-platform builds [1]. They are easy enough to stick in a shell script or batch file so you get all the builds with one command. These produce single executables, trimmed for size. [1] https://github.com/kcartlidge/Newt#generating-stand-alone-builds https://github.com/kcartlidge/Newt#generating-stand-alone-bu...