is a lightweight web-enablement glue library for the .NET ecosystem. With zero dependencies and requiring neither IIS nor Kestrel, it covers Web APIs, WebSocket real-time communication, website building, and static file hosting. It needs zero configuration, enables a WebAPI with a single line of code, and never forces your business logic into a specific pattern. It can effortlessly extend existing programs or serve as the foundation for building independent applications.
The rather than unrealistic, specially-tuned peak figures.
1. Core Product Positioning
PicoServer is a lightweight, high-performance, cross-platform web glue library built on .NET Standard 2.0.
Core Concept: .NET Application + PicoServer = A Web-Enabled Application
Core Philosophy: The library adapts to your business, not your business to the framework.
Compatibility Tenet: Embrace the past, oriented toward the future.
2. Design Philosophy: Simple and Powerful
PicoServer's genesis was straightforward: the author needed a fast way to build WebAPIs for his own projects. This pragmatic, "for-myself" instinct led to five core principles:
| Principle | Meaning | Engineering Implementation |
|---|---|---|
| Minimalist Path | The shortest distance from a network request to your business method. | Listen → Route → Method, a three-hop direct path. |
| Zero-Intrusion Integration | Never imposes an architecture or forces coding standards. | A single DLL (~50 KB), embeddable in a few lines of code. |
| Works Out of the Box | Ready to use instantly; no need to understand a complex system first. | No "Builder" pattern. One method call activates a feature. |
| Secure by Default | Secure without requiring complex configuration. | Anti-directory traversal, hidden file protection, automatic JWT expiry validation. |
| Fully Async Architecture | Built from the ground up with async/await. | Zero blocking threads, natively ready for io_uring and future async runtime enhancements. |
WebAPI With One Line of Code
var app = new WebAPIServer();
app.MapGet("/", (req, rsp) => rsp.WriteAsync("Hello PicoServer"));
app.StartServer();
3. Core Technical Capabilities
3.1 The "Three Pillars"
| Module | Function | Key Features |
|---|---|---|
| Route Mapping | Business Entrypoint | Exact, pattern-matching, RESTful, semantic, and attribute-based routing |
| Middleware Pipeline | Pre-processing Pipeline | AddMiddleware is fully open. Register only what you need, with no hidden or mandatory middleware. |
| Built-in Security | Foundational Security | Token/JWT/SM3 National Cryptography authentication, anti-directory traversal, and HttpOnly cookies |
3.2 A Full-Spectrum Feature Matrix
Provides three fundamental web capabilities on a single port within a single process:
WebAPI: Full HTTP method support, automatic parameter resolution, and JSON/Form/Stream responses.
WebSocket: Bidirectional communication, heartbeat detection, connection management, and broadcast/targeted messaging.
Static File Hosting: Caching strategies, MIME-type recognition, CORS configuration, and SPA support.
More Capabilities: Server-Sent Events (SSE), large file uploading/downloading with progress (and resume), live media streaming, and a built-in WebSocket client/server.
3.3 A First-Class Experience for Both C# and VB.NET
Complete documentation and sample code are provided for everything from basic routing to advanced middleware, equally for performance dataset.
6. Inherent Performance Dividends
PicoServer stands on the shoulders of giants with its ultra-thin architecture:
Minimalist Path: Listen → Route → Method, a direct three-hop journey.
No Hidden Middleware: PicoServer does not inject any forced middleware. You add only what your logic requires.
No Wrapping Overhead: Directly operates onHttpListenerRequest/Responseobjects, resulting in zero extra allocations.
Fully Async I/O: With zero blocking threads, it natively aligns withio_uringand future .NET runtime advancements, leaving system resources for your business.
Past and Future: It embraces both the classic.NET Frameworkand the modern.NET. Your code gains performance automatically, without modification.
Because the framework layer doesn't pile on redundant abstractions, runtime improvements like JIT optimizations, io_uring, and future async enhancements are more fully and directly translated into higher throughput.
7. Ideal Application Scenarios
| Scenario | Recommendation | Core Value |
|---|---|---|
| Modernizing Legacy .NET Systems with Web Capabilities | ★★★★★ | Zero-intrusion, no changes to existing code, supports both C# and VB.NET. |
| Industrial Automation / Edge Computing | ★★★★★ | Extremely low CPU and memory usage; WebAPI, WebSocket, and Web hosting ready for embedded Linux. |
| Embedding Web Features into Desktop Applications | ★★★★★ | Single DLL integration; proven by an MVP with a MAUI practice. |
| Xinchuang (Domestic Technology) Adaptation | ★★★★★ | Native SM3 national cryptography for signatures and password storage; full copyright compliance. |
| Enterprise Intranet Lightweight Services | ★★★★★ | Deployable as a single executable with nearly zero operational overhead. |
| Rapid Prototyping for New Projects | ★★★★★ | An extremely simple start without locking in users; supports smooth migration to ASP.NET Core. |
| Cloud-Native Lightweight Services | ★★★★★ | AOT-compiled for millisecond startup; high-density, multi-instance deployment. |
8. Conclusion
Documentation:
VB.NET Examples:
"Developer's Benchmark" Test: https://docs.picoserver.cn/benchmark.html
SOCIAL SHARE CARD GENERATOR