0

I've been developing a C# command line tool using Mono on a Mac (in Xamarin), with the intention that it should be straightforwardly cross-platform.

I'm now ready to release and open-source the project, and I want to make it as easy as possible for users on both Windows and Mac to start using the tool, without necessarily having to install Mono/Xamarin and build the project themselves. Therefore, I'd like to include binary releases on github.

For Mac: I already found that it's possible to make a native executable that includes the Mono runtime using mkbundle with the --static option enabled.

For Windows: What's the equivalent? And is it possible to cross-compile a native command line tool for Windows on a Mac, so that I don't have to use two different machines into to make a binary release?

Again, if at all possible, I'd like to make a Windows release that has no dependencies - I don't want the user to have to download Cygwin, Mono, Xamarin, Visual Studio, etc.

Joseph Humfrey
  • 2,974
  • 2
  • 23
  • 34
  • On Windows it is common practice to ship an MSI package for installation or simply a ZIP package if the .NET Framework is already installed. Microsoft's .NET Native is not yet ready for console apps, but it's coming soon. – Lex Li Mar 03 '16 at 10:49
  • So, if I just distribute a zip of the IL version of the executable (i.e. unbundled, just what's produced directly when compiling in Xamarin), will that just work automatically in cmd.exe on Windows if the .NET Framework is installed? – Joseph Humfrey Mar 03 '16 at 10:53
  • 1
    depends on which .NET profile you compile against and which .NET Framework is installed, yes, there is possibility to run it directly. – Lex Li Mar 03 '16 at 11:00
  • See also: http://stackoverflow.com/questions/551554/can-you-compile-c-sharp-so-it-doesnt-need-the-net-framework-at-runtime and other duplicates. You really cannot do this; the correct version of the .NET Framework *must* be installed to run your app, and you *cannot* simply rely on it being there. It might be there, and you might be fine. But if it's not, your app won't run—not fine. Dependencies are inevitable when targeting .NET. – Cody Gray - on strike Mar 03 '16 at 11:39
  • Oh, but this is actually useful: As long as I know which version of .NET I'm targeting (e.g. 3.0+), e.g. by looking at https://en.wikipedia.org/wiki/.NET_Framework#Release_history, then I'm fine - I can indeed distribute without worrying too much (and just add info to the readme). Broadly it'll work for most people. – Joseph Humfrey Mar 03 '16 at 16:36

0 Answers0