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
                    
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="DemiCode.Logging.log4net" Version="2.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="DemiCode.Logging.log4net" Version="2.0.0" />
                    
Directory.Packages.props
<PackageReference Include="DemiCode.Logging.log4net" />
                    
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 DemiCode.Logging.log4net --version 2.0.0
                    
#r "nuget: DemiCode.Logging.log4net, 2.0.0"
                    
#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 DemiCode.Logging.log4net@2.0.0
                    
#: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=DemiCode.Logging.log4net&version=2.0.0
                    
Install as a Cake Addin
#tool nuget:?package=DemiCode.Logging.log4net&version=2.0.0
                    
Install as a Cake Tool

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.Logging namespace
  • 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")

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

Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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.