LoadStrike lets .NET teams write C# load testing scenarios using familiar async code and HTTP clients. A scenario defines the workload, named steps record its stages, and load simulations control arrivals or concurrent copies. Start with one HTTP request before adding a source-to-destination completion check for work that continues after the response.
C# load testing for .NET applications
Write C# load and performance tests with LoadStrike on .NET 8+. Measure HTTP steps, async completion and reports from your own infrastructure.
How do you write a C# load test with LoadStrike?
Install and start an API load test in C#
The C# request-step snippet uses the LoadStrike namespace and HttpClient. Add it to a .NET 8+ project, replace the example API and placeholder runner key, and review client lifetime before running.
The request-step example offers 10 scenario invocations per second for 20 seconds. Replace the example endpoint with an authorized staging service and the placeholder with your valid runner key. Offered scenario invocations are not measured HTTP throughput or a benchmark result.
SDK installation
dotnet add package LoadStrike
Request-step example
using LoadStrike;
var httpClient = new HttpClient
{
BaseAddress = new Uri("https://api.example.com")
};
var scenario = LoadStrikeScenario.Create("read-order", async context =>
{
var orderId = $"ord-{context.InvocationNumber}";
var step = await LoadStrikeStep.Run<string>("GET /orders/{id}", context, async () =>
{
using var response = await httpClient.GetAsync($"/orders/{orderId}");
return response.IsSuccessStatusCode
? LoadStrikeResponse.Ok<string>(statusCode: ((int)response.StatusCode).ToString())
: LoadStrikeResponse.Fail<string>(
statusCode: ((int)response.StatusCode).ToString(),
message: "Order lookup failed");
});
return step.AsReply();
})
.WithLoadSimulations(
LoadStrikeSimulation.Inject(10, TimeSpan.FromSeconds(1), TimeSpan.FromSeconds(20))
);
LoadStrikeRunner.RegisterScenarios(scenario)
.WithRunnerKey("rkl_your_local_runner_key")
.Run();
Evidence to review
Use these pages and artifacts to validate the public claims on this page.
C# package and releases
Check the published package version before installing or pinning a dependency.
C# sample project
Inspect the project configuration, imports and source examples. Dummy runner keys must be replaced.
Installation and runtime requirements
Confirm supported runtime, optional clients and runner setup.
Who this is for
C# developers, ASP.NET API owners and test engineers who want performance tests reviewed alongside their application code. Use your existing .NET client, authentication and test-data setup so the scenario represents the service you actually operate rather than a simplified recording.
Package, runtime and client setup
Install the NuGet package LoadStrike with dotnet add package LoadStrike in a .NET 8+ test project. The namespace is LoadStrike. The request-step example uses HttpClient and Task-based callbacks; keep the client lifecycle deliberate and clean up resources after a run. The public C# sample project shows imports and project dependencies beyond the introductory snippet.
From request timing to completion
An HTTP 202 response can arrive before an order worker or Kafka consumer has finished. Define the completion event, preserve a shared tracking value in source and destination, configure the endpoint modes and set a correlation timeout. The report can then distinguish matched completion from timeouts and duplicates instead of treating acceptance as the entire outcome.
Execution and plan requirements
- Use NuGet package LoadStrike on .NET 8+ and provide a valid runner key. LoadStrike runs on your own infrastructure.
- Check the plan for the selected endpoints, reports and execution mode. gRPC and WebSocket endpoints require Pro or Enterprise; extra clients do not grant plan access.
- Review HTML, CSV, TXT or Markdown reports and run failures. These examples demonstrate SDK setup; they are not comparative benchmarks or throughput guarantees.
Define the workload and inspect the evidence
Start with a small request-step test against a staging system you control. To measure later completion, define the matching endpoints and tracking value before interpreting transaction latency.
C# request-step quick start
Set the language tab, replace the example target and configure runner access.
Tracking selectors
Verify that the same identifier reaches source and completion.
Report interpretation
Read summary, step timings, failed rows and correlated outcomes.
Introduce the workload into your test project
- Add one staging scenario beside your existing .NET integration tests. Keep correctness tests and performance acceptance criteria explicit; sharing a language does not make their workload or purpose identical.
- Start with a small arrival profile and check generator CPU, connection pooling, failures and report output before raising load. Use Playwright or Selenium only when actual browser actions belong in the measured journey.
Common questions
Can I use my existing C# HTTP client?
Yes. Put the HTTP operation inside a named LoadStrike step and return a success or failure reply. Your project still owns credentials, connection settings and cleanup.
Can C# tests include a browser and an async service?
The browser guides show C# Playwright and Selenium steps. Add downstream correlation only when the source and completion endpoint expose the same tracking value; confirm the selected plan covers every feature.
Related documentation
Start with the implementation details that match this page.
Installation
Install the LoadStrike package for your language and add it to the test project you already use. This page is the starting point before you write a scenario.
Quick Start
Build one basic request-step scenario around GET /orders/{id}, run it, and confirm the report before moving into correlation-specific features.
Load Simulation
Load simulations describe how traffic should arrive over time. Use them to model the shape of the workload instead of only its peak.
Playwright UI Load Guide
Use this guide when Playwright browser journeys should run inside the same LoadStrike scenario and reporting model.
Related comparisons
Use these comparison pages if you still need a tool-level decision.
LoadStrike vs k6
Compare LoadStrike and k6 for APIs, Kafka, browser tests and async completion, including correlation requirements, extensions and hosting tradeoffs.
LoadStrike vs Apache JMeter
Compare LoadStrike and Apache JMeter for async completion, JMS, browser execution, reports and self-hosted testing, including setup and licensing requirements.
Next steps
All SDKs and documentation
Choose another language or find the transport guide for your workload.
Transaction load testing
Decide which downstream event represents the real completion outcome.
Plans and runner access
Verify entitlements and current self-hosted pricing before rollout.
Start one C# performance scenario
Install the SDK, provide a valid runner key and review one small staging run before increasing load or adding downstream correlation.