Soenneker.Cron.Builder
4.0.302
Prefix Reserved
dotnet add package Soenneker.Cron.Builder --version 4.0.302
NuGet\Install-Package Soenneker.Cron.Builder -Version 4.0.302
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="Soenneker.Cron.Builder" Version="4.0.302" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Soenneker.Cron.Builder" Version="4.0.302" />
<PackageReference Include="Soenneker.Cron.Builder" />
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 Soenneker.Cron.Builder --version 4.0.302
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Soenneker.Cron.Builder, 4.0.302"
#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 Soenneker.Cron.Builder@4.0.302
#: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=Soenneker.Cron.Builder&version=4.0.302
#tool nuget:?package=Soenneker.Cron.Builder&version=4.0.302
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Soenneker.Cron.Builder
A fluent interface for building cron expressions with support for seconds, intervals, daily/weekly/monthly scheduling, and validation.
Install
dotnet add package Soenneker.Cron.Builder
Quick start
using Soenneker.Cron.Builder.Abstract;
ICronBuilder cronBuilder = /* resolve from DI */;
var result = cronBuilder.WithSeconds(1);
Sets the second (0-59) when the job should run.
What you get
ICronBuilder— A fluent interface for building cron expressions with support for seconds, intervals, daily/weekly/monthly scheduling, and validation.
API at a glance
| API | What it does | Result / important behavior |
|---|---|---|
ICronBuilder.WithSeconds(second) |
Sets the second (0-59) when the job should run. | The current cron builder instance. |
ICronBuilder.WithMinute(minute) |
Sets the minute (0-59) when the job should run. | The current cron builder instance. |
ICronBuilder.WithMinuteInterval(interval) |
Sets a recurring interval in minutes (e.g., every 5 minutes = 5). | The current cron builder instance. |
ICronBuilder.Minutely() |
Configures the job to run every minute (minute = "*"). | The current cron builder instance. |
ICronBuilder.WithHour(hour) |
Sets the hour (0-23) when the job should run. | The current cron builder instance. |
ICronBuilder.WithHourInterval(interval) |
Sets a recurring interval in hours (e.g., every 4 hours = 4). | The current cron builder instance. |
ICronBuilder.Hourly() |
Configures the job to run hourly, at the top of each hour (minute = 0). | The current cron builder instance. |
ICronBuilder.Daily(hour, minute) |
Configures the job to run daily at a specific time. | The current cron builder instance. |
ICronBuilder.OnDayOfMonth(day) |
Sets the day of the month (1–31) when the job should run. | The current cron builder instance. |
ICronBuilder.Weekly(day, hour, minute) |
Configures the job to run weekly on a specific day and time. | The current cron builder instance. |
ICronBuilder.Weekdays() |
Restricts the job to run only on weekdays (Monday through Friday). | The current cron builder instance. |
ICronBuilder.OnMonth(month) |
Sets the month (1–12) when the job should run. | The current cron builder instance. |
ICronBuilder.Monthly(dayOfMonth, hour, minute) |
Configures the job to run monthly on a specific day and time. | The current cron builder instance. |
ICronBuilder.OnDayOfWeek(day) |
Sets the job to run on a specific day of the week using an enum. | The current cron builder instance. |
ICronBuilder.OnDayOfWeek(cronDayOfWeek) |
Sets the job to run on a specific day of the week using a raw cron string. | The current cron builder instance. |
ICronBuilder.Annually(month, dayOfMonth, hour, minute) |
Configures the job to run annually on a specific month, day, and time. | The current cron builder instance. |
ICronBuilder.Build() |
Builds and returns the final cron expression string. | A valid cron expression. |
Important behavior
ICronBuilder.WithSeconds(second): Thrown ifsecondis outside the valid range (0–59).ICronBuilder.WithMinute(minute): Thrown ifminuteis outside the valid range (0–59).ICronBuilder.WithMinuteInterval(interval): Thrown ifintervalis outside the valid range (1–59).ICronBuilder.WithHour(hour): Thrown ifhouris outside the valid range (0–23).ICronBuilder.WithHourInterval(interval): Thrown ifintervalis outside the valid range (1–23).ICronBuilder.OnDayOfMonth(day): Thrown ifdayis outside the valid range (1–31).ICronBuilder.OnMonth(month): Thrown ifmonthis outside the valid range (1–12).ICronBuilder.Build(): Thrown if both day-of-month and day-of-week are set, which may result in ambiguous scheduling behavior.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. 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.
-
net10.0
- Soenneker.Enums.DayOfWeek (>= 4.0.760)
- Soenneker.Extensions.String (>= 4.0.723)
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 |
|---|---|---|
| 4.0.302 | 0 | 8/29/2026 |
| 4.0.301 | 71 | 8/26/2026 |
| 4.0.300 | 75 | 8/25/2026 |
| 4.0.299 | 73 | 8/25/2026 |
| 4.0.298 | 139 | 8/21/2026 |
| 4.0.297 | 92 | 8/21/2026 |
| 4.0.296 | 143 | 8/18/2026 |
| 4.0.295 | 88 | 8/18/2026 |
| 4.0.294 | 88 | 8/18/2026 |
| 4.0.293 | 94 | 8/18/2026 |
| 4.0.292 | 90 | 8/18/2026 |
| 4.0.291 | 107 | 8/12/2026 |
| 4.0.290 | 101 | 8/8/2026 |
| 4.0.289 | 99 | 8/7/2026 |
| 4.0.288 | 86 | 8/7/2026 |
| 4.0.287 | 113 | 7/29/2026 |
| 4.0.286 | 110 | 7/28/2026 |
| 4.0.285 | 102 | 7/28/2026 |
| 4.0.284 | 100 | 7/28/2026 |
| 4.0.283 | 95 | 7/28/2026 |
Loading failed
Improve README usability and API guidance