MT.LightTask 0.1.1

There is a newer version of this package available.
See the version list below for details.
dotnet add package MT.LightTask --version 0.1.1
                    
NuGet\Install-Package MT.LightTask -Version 0.1.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="MT.LightTask" Version="0.1.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="MT.LightTask" Version="0.1.1" />
                    
Directory.Packages.props
<PackageReference Include="MT.LightTask" />
                    
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 MT.LightTask --version 0.1.1
                    
#r "nuget: MT.LightTask, 0.1.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.
#:package MT.LightTask@0.1.1
                    
#: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=MT.LightTask&version=0.1.1
                    
Install as a Cake Addin
#tool nuget:?package=MT.LightTask&version=0.1.1
                    
Install as a Cake Tool

MT.LightTask

轻量定时任务

使用方式

// 注册服务
builder.Services.AddLightTask();

// 注册任务
var app = builder.Build();
// Configure the HTTP request pipeline.
app.UseLightTask(c =>
{
    c.AddTask("测试1", (sp, token) =>
    {
        Console.WriteLine($"Task测试1: {DateTime.Now:yyyy-MM-dd HH:mm:ss}");
        return Task.CompletedTask;
    }, b => b.WithCron("*/12 * * * * ?"));

    // TestTask需要实现ITask,并且注册到容器中
    c.AddTask<TestTask>("测试2", b => b.WithCron("*/5 * * * * ?").Build());
});

// TestTask
[AutoInject(ServiceType = typeof(TestTask))]
public class TestTask : ITask
{
    public Task ExecuteAsync(CancellationToken cancellationToken = default)
    {
        Console.WriteLine($"Task测试2: {DateTime.Now:yyyy-MM-dd HH:mm:ss}");
        return Task.CompletedTask;
    }
}
Product 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.  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 (1)

Showing the top 1 NuGet packages that depend on MT.LightTask:

Package Downloads
BlazorTemplate.Constraints

BlazorWebAdmin模板项目的组件

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2026.5.11.1 202 5/11/2026
2026.4.28.1 109 4/29/2026
2026.3.6.1 121 3/6/2026
2026.3.5.1 108 3/5/2026
2026.3.2.1 112 3/2/2026
2026.3.1.2 108 3/1/2026
2026.3.1.1 106 3/1/2026
2026.2.28.1 118 2/28/2026
2026.2.25.1 110 2/25/2026
0.1.3-pre 183 12/5/2025
0.1.2 421 11/18/2025
0.1.1 194 11/7/2025
0.1.0 213 8/19/2025
0.0.9 204 8/13/2025
0.0.8 209 7/10/2025
0.0.7 191 7/4/2025
0.0.6 200 6/18/2025
0.0.5 184 5/9/2025
0.0.4 227 4/21/2025
0.0.3 235 4/3/2025
Loading failed