ChrisMavrommatis.StartupTasks
2.0.0
ChrisMavrommatis.StartupTasks 2.0.1
Additional DetailsVersion 2.0.0 had different packages across frameworks. Please use 2.0.1 and up
See the version list below for details.
dotnet add package ChrisMavrommatis.StartupTasks --version 2.0.0
NuGet\Install-Package ChrisMavrommatis.StartupTasks -Version 2.0.0
<PackageReference Include="ChrisMavrommatis.StartupTasks" Version="2.0.0" />
paket add ChrisMavrommatis.StartupTasks --version 2.0.0
#r "nuget: ChrisMavrommatis.StartupTasks, 2.0.0"
// Install ChrisMavrommatis.StartupTasks as a Cake Addin #addin nuget:?package=ChrisMavrommatis.StartupTasks&version=2.0.0 // Install ChrisMavrommatis.StartupTasks as a Cake Tool #tool nuget:?package=ChrisMavrommatis.StartupTasks&version=2.0.0
StartupTasks
ChrisMavrommatis.StartupTasks
is a .NET library that enables you to define and execute a set of tasks during the startup phase of your ASP.NET Core application, just before the web host begins running.
Installation
Install the package via NuGet Package Manager
Install-Package ChrisMavrommatis.StartupTasks
Or via .NET CLI:
dotnet add package ChrisMavrommatis.StartupTasks
Usage
Create a startup task by inheriting from
IStartupTask
public class SampleStartupTask : IStartupTask { public async Task ExecuteAsync(CancellationToken cancellationToken = default) { // Your startup task logic here } }
Register the task using the
AddStartupTask
extension method// Other service registrations services.AddStartupTask<SampleStartupTask>(); // Other service registrations
Use the
RunStartupTasksAsync
extension method in your startup class just before you call theRunAsync
.public static async Task Main(string[] args) { /* ... Other Code */ await app.RunStartupTasksAsync(); await app.RunAsync(); }
License
This project is licensed under the MIT License. See the LICENSE file for details.
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 is compatible. |
-
net8.0
-
net9.0
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.