Workers 0.6.2
dotnet add package Workers --version 0.6.2
NuGet\Install-Package Workers -Version 0.6.2
<PackageReference Include="Workers" Version="0.6.2" />
<PackageVersion Include="Workers" Version="0.6.2" />
<PackageReference Include="Workers" />
paket add Workers --version 0.6.2
#r "nuget: Workers, 0.6.2"
#:package Workers@0.6.2
#addin nuget:?package=Workers&version=0.6.2
#tool nuget:?package=Workers&version=0.6.2
Workers
Write Cloudflare Workers in C# compiled to native JavaScript.
using Workers;
public static class Worker
{
[Fetch]
public static Response Fetch(Request request)
{
return new Response("Hello from C#!");
}
}
Getting started
Add the package to a .NET project and publish:
dotnet add package Workers
dotnet publish -c Release
The generated dist/worker.js is a native ES module ready for Wrangler. Configure bindings, routes, and deployment settings in your Wrangler configuration.
Workers uses a focused C# profile and native JavaScript/Web APIs. The full .NET BCL and arbitrary NuGet packages are not supported; unsupported APIs produce compiler diagnostics. Versions before 0.3.0 used .NET on WebAssembly. Version 0.6.0 includes breaking changes.
Examples
Start with HelloWorld, or browse the examples and usage notes for HTTP, routing, cookies, storage, queues, and scheduled events.
You can also explore a live demo built by Michiel Post.
| 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. |
-
net10.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.