PRI.ConsoleApplicationBuilder
1.0.0-rc.2
See the version list below for details.
dotnet add package PRI.ConsoleApplicationBuilder --version 1.0.0-rc.2
NuGet\Install-Package PRI.ConsoleApplicationBuilder -Version 1.0.0-rc.2
<PackageReference Include="PRI.ConsoleApplicationBuilder" Version="1.0.0-rc.2" />
paket add PRI.ConsoleApplicationBuilder --version 1.0.0-rc.2
#r "nuget: PRI.ConsoleApplicationBuilder, 1.0.0-rc.2"
// Install PRI.ConsoleApplicationBuilder as a Cake Addin #addin nuget:?package=PRI.ConsoleApplicationBuilder&version=1.0.0-rc.2&prerelease // Install PRI.ConsoleApplicationBuilder as a Cake Tool #tool nuget:?package=PRI.ConsoleApplicationBuilder&version=1.0.0-rc.2&prerelease
ConsoleApplicationBuilder
.NET has had a Dependency Injection (DI) feature for a while now. Out-of-the-box geneated ASP.NET applications and console worker project templates create startup code that creates a service collection and service provider (Dependency Injection Container), developers just need to add their services to the service collection and perform any configuration required.
Except for simple console applications.
Sometimes you just want to create the simplest of applications to do something very specific. A console application is good for that, but it doesn't have DI out of the box. The Console Worker template uses the .NET Generic Host, which does have DI out of the box. But the Console Worker template implements background worker functionality, which is bit heavy if you're just trying to do something simple, but with DI support.
This is where ConsoleApplicationBuilder comes into play.
public class Program
{
public static void Main(string[] args)
{
var program = ConsoleApplication.CreateBuilder(args).Build<Program>();
program.Run();
}
public void Run()
{
// ...
}
}
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. 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. |
-
net8.0
- Microsoft.Extensions.Hosting (>= 8.0.1)
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 | 34 | 1/17/2025 |
1.0.0-rc.2 | 30 | 1/17/2025 |
1.0.0-rc.1 | 37 | 1/16/2025 |