ConsoleFx assemblies and deployment scenarios

ConsoleFx ships with 2 assemblies:
  • ConsoleFx.dll: Contains the core classes, the parser and the classes needed to create simple and complex command-line applications using the fluent API.
  • ConsoleFx.Interactive.dll: Contains the classes needed to create an interactive shell application.

The ConsoleFx.Interactive assembly has a dependency on the ConsoleFx assembly.

Deployment scenarios

Normally, when using ConsoleFx in your CLI application, you will have to ship your application with the necessary ConsoleFX assemblies. However, most CLI applications tend to be self-contained and are normally only a single executable file. If you wish to deploy your application as a single executable file, or you simply do not want to ship your application with the ConsoleFx assemblies, you can use any of these options:

Option 1 (recommended) : Embed ConsoleFx source code in your application project

The recommended deployment option is to include the required ConsoleFx source code directly into your CLI application's code and compile the whole thing into a single executable.

This is made easy with the availability of ConsoleFx's code packages on NuGet, which embed the source code into your project, instead of adding references to the assemblies.
And the best part is - whenever ConsoleFx gets updated, you get the option to update your project to the latest version, so you're always up-to-date.

Currently, the following code packages are available on NuGet:

Option 2 : Embed the ConsoleFx DLLs in your application and load them on demand

From Jeffrey Richter's blog post at http://blogs.msdn.com/b/microsoft_press/archive/2010/02/03/jeffrey-richter-excerpt-2-from-clr-via-c-third-edition.aspx, you can embed the ConsoleFx DLLs as resources in your console application and load them dynamically when the application starts.

Option 3 : Merge your assemblies using the ILMerge tool

ILMerge is a free utility that can be used to merge multiple .NET assemblies into a single assembly.
It is available http://research.microsoft.com/en-us/people/mbarnett/ILMerge.aspx. The download link to the latest version is at http://www.microsoft.com/en-us/download/details.aspx?id=17630.

Using ILMerge, you can merge one or more ConsoleFx assemblies into your CLI executable file to produce a single executable.

ILMerge /target:exe /out:MyConsoleApp.exe MyApp.exe ConsoleFx.dll ConsoleFx.Interactive.dll

Typically, you would perform this step as a post-build action, or as part of your continuous integration process.

Last edited Mar 22, 2014 at 11:12 AM by jeevanjj, version 7

Comments

No comments yet.