DemiCode.Logging.log4net
2.0.0
dotnet add package DemiCode.Logging.log4net --version 2.0.0
NuGet\Install-Package DemiCode.Logging.log4net -Version 2.0.0
<PackageReference Include="DemiCode.Logging.log4net" Version="2.0.0" />
<PackageVersion Include="DemiCode.Logging.log4net" Version="2.0.0" />
<PackageReference Include="DemiCode.Logging.log4net" />
paket add DemiCode.Logging.log4net --version 2.0.0
#r "nuget: DemiCode.Logging.log4net, 2.0.0"
#:package DemiCode.Logging.log4net@2.0.0
#addin nuget:?package=DemiCode.Logging.log4net&version=2.0.0
#tool nuget:?package=DemiCode.Logging.log4net&version=2.0.0
DemiCode Scheduler
A robust, lightweight job scheduling framework for .NET applications. Schedule and run tasks at specific intervals or times with full cross-platform support.
Features
- Multiple Schedule Types: Daily, weekly, monthly, interval-based, and custom schedules
- Task Types: Application tasks (executables), code tasks (methods), and custom implementations
- Cross-Platform: Works on Windows, Linux, and macOS (.NET Standard 2.0+ and .NET Framework 4.8)
- Thread-Safe: Built-in thread safety with proper locking and state management
- Flexible Configuration: XML or programmatic configuration
- Extensible: Easy to create custom schedules and task types
- Strong-Named: All assemblies are strong-named for GAC deployment
Quick Start
Installation
dotnet add package DemiCode.Scheduling
For log4net integration:
dotnet add package DemiCode.Logging.log4net
Basic Usage
using DemiCode.Scheduling;
using DemiCode.Scheduling.Schedules;
using DemiCode.Scheduling.Tasks;
// Create a scheduler
var scheduler = new Scheduler();
// Create a task
var task = new ApplicationTask("notepad.exe");
// Create a schedule (run every 5 minutes)
var schedule = new IntervalSchedule(TimeSpan.FromMinutes(5));
// Create and add a job
var job = new Job("MyJob", task, schedule);
scheduler.Jobs.Add(job);
// Start the scheduler
scheduler.Start();
// Stop when done
scheduler.Stop();
Configuration Example
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<section name="scheduler" type="DemiCode.Scheduling.SchedulerSection, DemiCode.Scheduling"/>
</configSections>
<scheduler>
<job name="Backup" type="DemiCode.Scheduling.Job">
<task type="DemiCode.Scheduling.Tasks.ApplicationTask">
<constructor>
<parameter type="System.String">backup.exe</parameter>
</constructor>
</task>
<schedule type="DemiCode.Scheduling.Schedules.DailySchedule">
<constructor>
<parameter type="System.TimeSpan">02:00:00</parameter>
</constructor>
</schedule>
</job>
</scheduler>
</configuration>
Package Structure
- DemiCode.Shared: Core utilities and base types
- DemiCode.Scheduling: Main scheduling engine, schedules, and tasks
- DemiCode.Logging.log4net: log4net integration for scheduler logging
Version 2.0 Breaking Changes
Logger Namespace Consolidation
- Consolidated all logging types into
DemiCode.Loggingnamespace - Update:
using DemiCode.Logging.Loggers;→using DemiCode.Logging;
ApplicationTask Shell Execution
- Changed to direct process execution (no shell)
- For shell features, explicitly invoke the shell:
- Windows:
new ApplicationTask("cmd.exe", "/c", "your command") - Linux/macOS:
new ApplicationTask("/bin/sh", "-c", "your command")
- Windows:
Documentation
For complete documentation, examples, and migration guides, visit: https://github.com/KodeCompagniet/demicode-scheduling
License
This project is licensed under the MIT License - see the LICENSE file for details.
Support
- Report issues: GitHub Issues
- Discussions: GitHub Discussions
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. 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. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 is compatible. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETFramework 4.8
- DemiCode.Shared (>= 2.0.0)
- log4net (>= 2.0.15)
-
.NETStandard 2.0
- DemiCode.Shared (>= 2.0.0)
- log4net (>= 2.0.15)
- System.Configuration.ConfigurationManager (>= 8.0.0)
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 |
|---|---|---|
| 2.0.0 | 186 | 10/22/2025 |
## Version 2.0.0
### Breaking Changes
- Removed obsolete `Scheduler.CreateFromConfig(...)` overloads; switch to `SchedulerFactory.CreateFromConfig(...)`.
- Removed the legacy `DemiCode.Logging` assembly and type forwarders; reference `DemiCode.Shared` for `DemiCode.Logging` types.
- Consolidated logging namespaces - update using statements from DemiCode.Logging.Loggers to DemiCode.Logging
- ApplicationTask now uses direct process execution instead of shell - use explicit shell invocation for shell features
### Fixed
- MonthlySchedule now correctly implements monthly scheduling on the first of each month
- MonthlySchedule properly respects toDate boundaries without emitting extra occurrences
- CodeTask correctly invokes static methods without requiring parameterless constructors
### Added
- Cross-platform argument handling for ApplicationTask
- Comprehensive unit tests for edge cases
See https://github.com/KodeCompagniet/demicode-scheduling/blob/main/CHANGELOG.md for full details.