kdheath.Application.Helper
2.0.1
Prefix Reserved
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
<PackageReference Include="kdheath.Application.Helper" Version="2.0.1" />
paket add kdheath.Application.Helper --version 2.0.1
#r "nuget: kdheath.Application.Helper, 2.0.1"
// 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 | Versions 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. |
-
.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.
* Corrected the Source Link paths by specifying the source repository URL as the root rather than a sub-folder.