Agent Skill
2/7/2026

csharp-sse-support

This skill describes how to implement the server part of Server-Sent Events (SSE) in modern .NET (ASP.NET Core). Use this skill when the user asks about "SSE in .NET / ASP.NET Core".

R
rstropek
0GitHub Stars
1Views
npx skills add rstropek/2026-01-27-copilot

SKILL.md

Namecsharp-sse-support
DescriptionThis skill describes how to implement the server part of Server-Sent Events (SSE) in modern .NET (ASP.NET Core). Use this skill when the user asks about "SSE in .NET / ASP.NET Core".

name: csharp-sse-support description: This skill describes how to implement the server part of Server-Sent Events (SSE) in modern .NET (ASP.NET Core). Use this skill when the user asks about "SSE in .NET / ASP.NET Core".

ASP.NET Core Minimal APIs have built-in SSE result support in ASP.NET Core 10 via Results.ServerSentEvents(...) / TypedResults.ServerSentEvents(...) returning a ServerSentEventsResult<T> from an IAsyncEnumerable.

Minimal API example (strings)

app.MapGet("/events", () =>
{
    async IAsyncEnumerable<string> Stream([System.Runtime.CompilerServices.EnumeratorCancellation] CancellationToken ct = default)
    {
        while (!ct.IsCancellationRequested)
        {
            yield return $"Server time: {DateTimeOffset.UtcNow:O}";
            await Task.Delay(1000, ct);
        }
    }

    // Sends SSE data using built-in result support
    return Results.ServerSentEvents(Stream());
});
Skills Info
Original Name:csharp-sse-supportAuthor:rstropek