Static compilation in the .NET world

后端 未结 2 576
再見小時候
再見小時候 2020-12-30 03:06

I\'ll be writing a small desktop app for a client that has WinXP machines and they won\'t be installing the .NET framework (at least not for me).

So my choices are

相关标签:
2条回答
  • 2020-12-30 03:50

    You can try to use Remotesoft Salamander.

    It does exactly what you want.

    0 讨论(0)
  • 2020-12-30 03:54

    Mono has vastly improved its support for Ahead of Time compilation (AOT) to the point where, assuming you are willing/able to target Mono rather than the .Net runtime, it should be possible to statically compile virtually any CIL application.

    Whether or not that is a good idea overall depends entirely on the application and your constraints.

    For example, Novell now ships MonoTouch, a CLI implementation which is fully AOT compiled and linked to allow .Net applications (not just games) to run on the iPhone against the CocoaTouch framework.

    Those same AOT techniques can be used to compile a Winforms application which would not require either the .Net or Mono runtime as prerequisites. There are a lot of performance tradeoffs (both positive and negative) related to AOT, so I would not move forward without due diligence.


    Edit:

    In response to John Saunders' question regarding "why not just install it for them?". That actually brings up one reason why you might need AOT compilation.. Bootstrappers.

    In order to install anything, you have to run an executable. You can either distribute an MSI (which will launch msiexec.exe implicitly) or you can distribute an exe. MSI, while functional, is a pretty terrible developer experience. So you could build your bootstrapper using .NET (AOT compiled eliminate the runtime dependency) which installs whatever prerequisites are necessary (such as .NET) before installing your app.

    Additionally, some companies may need to ship downloadable executables that don't require users to install anything (silently or otherwise).

    Yet another: Installing .NET requires administrative privileges. AOT may allow you to get around that requirement for your application.

    Again, whether any of that is a good idea depends entirely on the application and on your constraints.

    0 讨论(0)
提交回复
热议问题