Kestrun 1.0.0-alpha.3
dotnet add package Kestrun --version 1.0.0-alpha.3
NuGet\Install-Package Kestrun -Version 1.0.0-alpha.3
<PackageReference Include="Kestrun" Version="1.0.0-alpha.3" />
<PackageVersion Include="Kestrun" Version="1.0.0-alpha.3" />
<PackageReference Include="Kestrun" />
paket add Kestrun --version 1.0.0-alpha.3
#r "nuget: Kestrun, 1.0.0-alpha.3"
#:package Kestrun@1.0.0-alpha.3
#addin nuget:?package=Kestrun&version=1.0.0-alpha.3&prerelease
#tool nuget:?package=Kestrun&version=1.0.0-alpha.3&prerelease
██╗ ██╗███████╗███████╗████████╗██████╗ ██╗ ██╗███╗ ██╗
██║ ██╔╝██╔════╝██╔════╝╚══██╔══╝██╔══██╗██║ ██║████╗ ██║
█████╔╝ █████╗ ███████╗ ██║ ██████╔╝██║ ██║██╔██╗ ██║
██╔═██╗ ██╔══╝ ╚════██║ ██║ ██╔██╗ ██║ ██║██║╚██╗██║
██║ ██╗███████╗███████║ ██║ ██║ ██╗ ╚██████╔╝██║ ╚████║
╚═╝ ╚═╝╚══════╝╚══════╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═══╝
Kestrun — PowerShell brains. Kestrel speed.
Kestrun is a hybrid web framework that combines the speed and scalability of ASP.NET Core (Kestrel) with the flexibility and scripting power of PowerShell. It enables you to build web APIs, automation endpoints, and dynamic services using both C# and PowerShell in a single, integrated environment.
Rich Documentation and Tutorial
Full documentation and tutorial for Kestrun is available online at docs.kestrun.dev. You can find guides, API references, and usage examples to help you get started and explore advanced features.
Core Capabilities
🚀 Fast, cross-platform web server Powered by ASP.NET Core (Kestrel) with full access to advanced HTTP/2, header compression, and TLS options.
🐚 Native PowerShell integration Routes can be backed by PowerShell scripts with isolated, pooled runspaces and dynamic
$Context.Request
/$Context.Response
variables.🧠 Multi-language script routing Register HTTP routes using:
🐚 PowerShell For Building:
.NET 8 SDK AND .NET 9 SDK (solution multi-targets net8.0 + net9.0)
PowerShell 7.4+ (7.4 / 7.5 run on .NET 8; 7.6 preview runs on .NET 9)
Invoke-Build and Pester PowerShell modules:
Install-PSResource -Name 'InvokeBuild','Pester' -Scope CurrentUser
For Runtime (Run Only):
If you're only running Kestrun apps (not building from source), install the ASP.NET Core Runtime matching the PowerShell version you are using:
PowerShell Version Install (Run-only) Rationale 7.4 / 7.5 .NET 8 ASP.NET Core Runtime Bundles Microsoft.NETCore.App + Microsoft.AspNetCore.App 8.x 7.6 (preview) .NET 9 ASP.NET Core Runtime Preview runtime aligning with PS 7.6 build Installing the .NET SDK already gives you the corresponding runtimes. For run-only scenarios the ASP.NET Core Runtime alone is sufficient (it includes the base .NET runtime).
Download PowerShell from the official PowerShell Releases.
Verify installation
# List SDKs (expect 8.x and 9.x if building from source) dotnet --list-sdks # List runtimes (look for Microsoft.NETCore.App and Microsoft.AspNetCore.App) dotnet --list-runtimes | Where-Object { $_ -match 'Microsoft.(AspNetCore|NETCore).App' }
Expected (abbreviated):
Microsoft.NETCore.App 8.0.x Microsoft.AspNetCore.App 8.0.x Microsoft.NETCore.App 9.0.x Microsoft.AspNetCore.App 9.0.x
If something is missing, install the matching ASP.NET Core Runtime from the download links above.
Build & Run
Clone the repository:
git clone https://github.com/Kestrun/Kestrun.git cd Kestrun
🛠️ CI/CD ready
- Build- and run-time configurable
- Works in containerized / headless environments
- Supports Dev/Prod fallback module path detection
🛡️ Optional Add-ons Add via fluent extensions:
AddAntiforgery()
middlewareAddStaticFiles()
,AddDefaultFiles()
,AddFileServer()
AddCors(policy)
orAddCorsAllowAll()
AddSignalR<T>()
for real-time hubsAddAuthentication()
with multiple schemes (Windows, Basic, JWT, Certificate, etc.)- Ready for Swagger, gRPC, custom middleware hooks
⚡ Task Scheduling & Background Jobs
- Cron-based scheduling: Full cron expression support via Cronos
- Multi-language job support: Schedule PowerShell, C#, and VB.NET scripts as background jobs
- Job management: Start, stop, and monitor scheduled tasks with detailed logging
Deployment & Extensibility
This section summarizes extension capabilities (see earlier sections for build & run instructions).
Using the PowerShell Module
Import the module (from source):
Import-Module ./src/PowerShell/Kestrun/Kestrun.psm1
Running Tests
Using Invoke-Build (Recommended)
The project includes an Invoke-Build script that automatically handles both C# (xUnit) and PowerShell (Pester) tests:
Invoke-Build Test
Manual Test Execution
C# Tests
Invoke-Build Kestrun.Tests
PowerShell Tests
Invoke-Build Test-Pester
Documentation and Tutorial
Kestrun docs are built with Just-the-Docs.
All new documentation must be compatible (front matter, parent
, nav_order
, etc.).
See docs/ for structure.
Project Structure
src/CSharp/
— C# core libraries and web serverKestrun/Authentication
— authentication handlers and schemesKestrun/Certificates
— certificate management utilitiesKestrun/Hosting
— host configuration and extensionsKestrun/Languages
— multi-language scripting support (C#, VB.NET, etc.)Kestrun/Logging
— Serilog integration and logging helpersKestrun/Middleware
— custom middleware componentsKestrun/Models
— request/response classes and data modelsKestrun/Razor
— Razor Pages integration with PowerShellKestrun/Scheduling
— task scheduling and background job supportKestrun/Scripting
— script execution and validationKestrun/Security
— security utilities and helpersKestrun/SharedState
— thread-safe global state managementKestrun/Utilities
— shared utility functions
src/PowerShell/
— PowerShell module and scriptsexamples/
— Example projects and demonstrationsCSharp/Authentication
— authentication examplesCSharp/Certificates
— certificate usage examplesCSharp/HtmlTemplate
— HTML templating examplesCSharp/MultiRoutes
— multi-route examplesCSharp/RazorSample
— Razor Pages examplesCSharp/Scheduling
— task scheduling examplesCSharp/SharedState
— shared state examplesPowerShell/
— PowerShell examplesFiles/
— test files and resources
tests/
— Test projects (C#, PowerShell)docs/
— Documentation files (Just-the-Docs)Utility/
— Build and maintenance scripts.github/
— GitHub Actions workflowsLint/
— Code analysis rules
Contributing
Contributions of all sizes are welcome — from docs improvements to new feature modules. See CONTRIBUTING.md and the online guide at https://docs.kestrun.dev/contributing.
License
Licensed under the MIT License. See LICENSE.
Acknowledgements
Documentation
- Just-the-Docs for documentation
Code Quality
- ReportGenerator for code coverage reporting
- codefactor for code quality analysis
- coveralls for code coverage tracking
AI Assistance
Collaboration and Version Control
- GitHub for version control and collaboration
- NuGet for package management
- PowerShell Gallery for PowerShell modules
Scripting and Automation
- PowerShell for scripting and automation
- .NET for the underlying framework
- Pester for PowerShell testing
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. 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. |
-
net8.0
- BouncyCastle.Cryptography (>= 2.6.2)
- Cronos (>= 0.11.0)
- CsvHelper (>= 33.1.0)
- Microsoft.AspNetCore.Authentication.Certificate (>= 8.0.20)
- Microsoft.AspNetCore.Authentication.JwtBearer (>= 8.0.20)
- Microsoft.AspNetCore.Authentication.Negotiate (>= 8.0.20)
- Microsoft.AspNetCore.Authentication.OpenIdConnect (>= 8.0.20)
- Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation (>= 8.0.20)
- Microsoft.ClearScript.V8 (>= 7.5.0)
- Microsoft.CodeAnalysis (>= 4.9.2)
- Microsoft.CodeAnalysis.Analyzers (>= 4.14.0)
- Microsoft.CodeAnalysis.CSharp (>= 4.9.2)
- Microsoft.CodeAnalysis.CSharp.Scripting (>= 4.9.2)
- Microsoft.CodeAnalysis.CSharp.Workspaces (>= 4.9.2)
- Microsoft.CodeAnalysis.Razor (>= 6.0.36)
- Microsoft.CodeAnalysis.Scripting.Common (>= 4.9.2)
- Microsoft.CodeAnalysis.VisualBasic (>= 4.9.2)
- Microsoft.CodeAnalysis.VisualBasic.Workspaces (>= 4.9.2)
- Microsoft.Extensions.DependencyInjection (>= 8.0.1)
- Microsoft.Extensions.Hosting (>= 8.0.1)
- Microsoft.Extensions.Hosting.Abstractions (>= 8.0.1)
- Microsoft.Extensions.Logging.Console (>= 8.0.1)
- Microsoft.Extensions.Primitives (>= 8.0.0)
- Microsoft.IdentityModel.JsonWebTokens (>= 8.14.0)
- Microsoft.IdentityModel.Tokens (>= 8.14.0)
- Microsoft.PowerShell.SDK (>= 7.4.12)
- MongoDB.Bson (>= 3.5.0)
- Newtonsoft.Json (>= 13.0.3)
- PeterO.Cbor (>= 4.5.5)
- pythonnet (>= 3.0.5)
- Serilog (>= 4.3.0)
- Serilog.AspNetCore (>= 8.0.3)
- Serilog.Enrichers.Environment (>= 3.0.1)
- Serilog.Exceptions (>= 8.4.0)
- Serilog.Sinks.Console (>= 6.0.0)
- Serilog.Sinks.EventLog (>= 4.0.0)
- Serilog.Sinks.File (>= 7.0.0)
- Serilog.Sinks.Http (>= 9.1.0)
- Serilog.Sinks.SyslogMessages (>= 4.0.0)
- System.IdentityModel.Tokens.Jwt (>= 8.14.0)
- YamlDotNet (>= 16.3.0)
-
net9.0
- BouncyCastle.Cryptography (>= 2.6.2)
- Cronos (>= 0.11.0)
- CsvHelper (>= 33.1.0)
- Microsoft.AspNetCore.Authentication.Certificate (>= 9.0.9)
- Microsoft.AspNetCore.Authentication.JwtBearer (>= 9.0.9)
- Microsoft.AspNetCore.Authentication.Negotiate (>= 9.0.9)
- Microsoft.AspNetCore.Authentication.OpenIdConnect (>= 9.0.9)
- Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation (>= 9.0.9)
- Microsoft.ClearScript.V8 (>= 7.5.0)
- Microsoft.CodeAnalysis (>= 4.9.2)
- Microsoft.CodeAnalysis.Analyzers (>= 4.14.0)
- Microsoft.CodeAnalysis.CSharp (>= 4.9.2)
- Microsoft.CodeAnalysis.CSharp.Scripting (>= 4.9.2)
- Microsoft.CodeAnalysis.CSharp.Workspaces (>= 4.9.2)
- Microsoft.CodeAnalysis.Razor (>= 6.0.36)
- Microsoft.CodeAnalysis.Scripting.Common (>= 4.9.2)
- Microsoft.CodeAnalysis.VisualBasic (>= 4.9.2)
- Microsoft.CodeAnalysis.VisualBasic.Workspaces (>= 4.9.2)
- Microsoft.Extensions.DependencyInjection (>= 9.0.9)
- Microsoft.Extensions.Hosting (>= 9.0.9)
- Microsoft.Extensions.Hosting.Abstractions (>= 9.0.9)
- Microsoft.Extensions.Logging.Console (>= 9.0.9)
- Microsoft.Extensions.Primitives (>= 9.0.9)
- Microsoft.IdentityModel.JsonWebTokens (>= 8.14.0)
- Microsoft.IdentityModel.Tokens (>= 8.14.0)
- Microsoft.PowerShell.SDK (>= 7.4.12)
- MongoDB.Bson (>= 3.5.0)
- Newtonsoft.Json (>= 13.0.3)
- PeterO.Cbor (>= 4.5.5)
- pythonnet (>= 3.0.5)
- Serilog (>= 4.3.0)
- Serilog.AspNetCore (>= 9.0.0)
- Serilog.Enrichers.Environment (>= 3.0.1)
- Serilog.Exceptions (>= 8.4.0)
- Serilog.Sinks.Console (>= 6.0.0)
- Serilog.Sinks.EventLog (>= 4.0.0)
- Serilog.Sinks.File (>= 7.0.0)
- Serilog.Sinks.Http (>= 9.2.0)
- Serilog.Sinks.SyslogMessages (>= 4.0.0)
- System.IdentityModel.Tokens.Jwt (>= 8.14.0)
- YamlDotNet (>= 16.3.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 |
---|---|---|
1.0.0-alpha.3 | 244 | 9/16/2025 |
1.0.0-alpha.2 | 89 | 9/5/2025 |