简体   繁体   中英

Running C# application with .NET - MONO

I have a simple application made using C#.

Now how do I make it , such that it runs on all systems. If a PC does not have .NET framework installed - it shouldsiliently install it with only the bare minimum requirements that the program needs. Installing .NET framework - too big in size compared to many program , which is just a few kilobytes. Also is shoulf be silent and only if required. Basically the application should be light and capable to run in all Windows systems. Not interested in getting to Linux users.

Should I use Mono Project. Else is there a way to get the bare minim .NET framework selectively pre-installed.

Please advise.

Thanks

Have a look at mkbundle . It will create a standalone executable, with no other dependencies. In particular it does not need neither the Mono runtime nor .NET to be installed in order to execute.

The size might still be a problem (it will likely be several megabytes, even compressed), so there is another tool to strip out everything you don't need from the assemblies: the monolinker .

Note that the size will likely not reach the kilobyte range even after doing all this.

You can do this with a lot of work and the help of the Mono framework. See Embedding Mono for more information.

嵌入单声道

All that considered, it would be much easier to use a boostrapper to get a version of the .NET Client Framework installed. But you're going to lose the ability to install silently or be in the "kilobytes" footprint.

不幸的是,您不能在未安装.NET框架的计算机上运行.NET程序,并且可以使程序的安装程序自动下载该框架,但不能在.NET中进行下载。

To run .net applications you need the .net framework installed, that should be either the full version or the limited client profile edition.

The easiest way is to create a setup project from VS and require the .net version you want... the installer should be able to install the .net framework from the internet so you are not required to ship it with the app, which you can do by the way from the installer.

Mono won't be different since it still needs to be installed on the system. Mono however has full AOT support, but I don't have any idea whether that would help you or not... it is still a huge overkill anyway.

If you need your app to be small and run on ANY windows without any dependencies, you should do in c/c++ or vb6 whose runtime ships with most windows versions.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM