CodeExampleRunner.Console 1.0.0

dotnet add package CodeExampleRunner.Console --version 1.0.0
                    
NuGet\Install-Package CodeExampleRunner.Console -Version 1.0.0
                    
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="CodeExampleRunner.Console" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="CodeExampleRunner.Console" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="CodeExampleRunner.Console" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add CodeExampleRunner.Console --version 1.0.0
                    
#r "nuget: CodeExampleRunner.Console, 1.0.0"
                    
#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.
#:package CodeExampleRunner.Console@1.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=CodeExampleRunner.Console&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=CodeExampleRunner.Console&version=1.0.0
                    
Install as a Cake Tool

CodeExampleRunner.Console

A stone throw example runner to allow you to play with C# Code without the mess that comes with having to edit/re-edit the main method and other jazz

Not the prettiest thing but will definitely help aid that late night research/code practise when playing around with new concepts that don't need dedicated projects.

This runner allows you to additively add code to be ran via the console

  • complexity of O(N) (per class)

image

How to Use

  1. Use the IExample interface from the ExampleRunner and place it on your code example class that you would like to run
public interface IExample
{
    public bool Skip { get; set; } // Used to skip the example at runtime
    public void RunExample(); // Method that is invoked to run the example - your example's "main" method per say
}
  1. Inside your Console Project's Main method use the code below
public static void Main()
{
    ExampleRunner runner = new();
    runner.ScanAndRunExamplesInCurrentAssembly();
}
Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  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.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0 394 5/22/2022