0

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

5
  • You can't. .NET applications require the corresponding version and subset of the .NET framework to be installed. Have a look at this question: stackoverflow.com/questions/4784680/… Commented Jul 6, 2012 at 12:24
  • @J.Steen No, there is a subset called the Compact Framework. But yes, it still needs to be installed. Commented Jul 6, 2012 at 12:26
  • @roken, "full .NET framework" would mean any subset required by the framework he/she's currently using, of course. =) I shall fix. Commented Jul 6, 2012 at 12:27
  • Are you opposed to using an installer for your application? Commented Jul 6, 2012 at 12:27
  • I agree with @SaeidYazdani, other alternative is freepascal. Commented Jul 6, 2017 at 9:51

4 Answers 4

2

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.

Sign up to request clarification or add additional context in comments.

Comments

1

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

Embedding Mono

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.

2 Comments

Can you recommend the best way to bootstrap. My code is in simple c# , .NET framework 2 is sufficient. What would be the simplest/smallest hassle free way to install the .NET smoothly offline if not present (if present it should not disturb much).
@user1506713 ClickOnce is pretty straightforward, although it's got a handful of limitations.
0

Unfortunately you cant run a .NET program on a machine that does not have the .NET framework installed and the installer of the program could be made to download the framework automatically but not in .NET .

Comments

0

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.