kdheath.Application.Helper 2.0.1

Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
dotnet add package kdheath.Application.Helper --version 2.0.1                
NuGet\Install-Package kdheath.Application.Helper -Version 2.0.1                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="kdheath.Application.Helper" Version="2.0.1" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add kdheath.Application.Helper --version 2.0.1                
#r "nuget: kdheath.Application.Helper, 2.0.1"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install kdheath.Application.Helper as a Cake Addin
#addin nuget:?package=kdheath.Application.Helper&version=2.0.1

// Install kdheath.Application.Helper as a Cake Tool
#tool nuget:?package=kdheath.Application.Helper&version=2.0.1                

About

The Application.Helper package is a light-weight platform for .NET console applications.

See Change Log for release notes.

Key Features

  • Supports .NET Framework, .NET Core, and .NET 5.0+

It provides:

  • The title of the program from the assembly attributes.
  • The name of the configuration file (if it can be determined).
  • The elapsed time of the starting and stopping of the program.
  • Methods to suspend and resume elapse time recording are available.
  • Indication of whether the program is running in debug mode.
  • Indication of whether help was requested from the command line arguments.

How to Use

To provide help information about the program:

  • Create a new class and use the ConsoleApp class as the base class.
  • Override the ShowProgramInfo() method. This is called during the start process and is triggered by the user providing a question mark (?) anywhere in the first argument.

To use in a C# program:

using Application.Helper;

private static readonly ConsoleApp sApp = new();

The main entry point method would look like:

static void Main( string[] args )
{
  var result = false;
  try
  {
    sApp.StartApp( args );
    Console.WriteLine( sApp.FormatTitleLine( " Starting " + sApp.Title + " " ) );
    result = Processing();
  }
  catch( Exception ex )
  {
    // Do something to log the error
  }
  finally
  {
    sApp.StopApp( result );
  }
  Environment.Exit( Environment.ExitCode );
}

The output looks like this:

Start..: 20:16:31.8915290

------------------- Starting Test Harness [Version 1.0.1.1] --------------------

Runtime: 00:00:00.2836824
Result.: Success

Press any key to continue . . .

Main Types

  • ConsoleApp - Helper class for Console Applications.
  • GenericException - Represents errors that occur during application execution.

Feedback

This is provided as open source under the MIT license.
Bug reports and contributions are welcome at the GitHub repository.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETStandard 2.0

    • No dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on kdheath.Application.Helper:

Package Downloads
kdheath.Logging.Helper

The logging helper is a light-weight platform for .NET with rich log routing and management capabilities provided by NLog.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
2.0.5 90 5/1/2024
2.0.4 132 4/1/2024
2.0.3 184 3/3/2024
2.0.2 241 2/17/2024
2.0.1 1,403 12/8/2023
2.0.0 679 11/30/2023
1.0.3 651 11/21/2023 1.0.3 is deprecated.
1.0.2 683 11/11/2023 1.0.2 is deprecated.

* Corrected the Source Link paths by specifying the source repository URL as the root rather than a sub-folder.