DEV.co
Open-Source Testing · wiremock

WireMock.Net

WireMock.Net is a C# HTTP mocking library that lets you stub and mock web responses for testing. It can run as a library in tests, a standalone service, or in Docker, and supports advanced features like request matching, response templating, gRPC, and GraphQL.

Source: GitHub — github.com/wiremock/WireMock.Net
1.7k
GitHub stars
240
Forks
C#
Primary language
Apache-2.0
License (OSI-approved)

Key facts

Objective fields from the source. Values we can't verify are shown as “Unknown” rather than guessed.

FieldValue
Repositorywiremock/WireMock.Net
Ownerwiremock
Primary languageC#
LicenseApache-2.0 — OSI-approved
Stars1.7k
Forks240
Open issues23
Latest release2.12.0 (2026-07-07)
Last updated2026-07-07
Sourcehttps://github.com/wiremock/WireMock.Net

What WireMock.Net is

WireMock.Net provides HTTP response stubbing with URL/header/body matching, runs embedded or as a standalone process, supports Handlebars templating, record/playback, stateful behavior, gRPC/ProtoBuf, and integrates with .NET testing frameworks, Aspire, and container platforms.

Quickstart

Get the WireMock.Net source

Clone the repository and explore it locally.

terminalbash
git clone https://github.com/wiremock/WireMock.Net.gitcd WireMock.Net# follow the project's README for install & configuration

Need it deployed, integrated, or customized instead? DEV.co ships production installs.

Best use cases

Unit and integration testing of .NET applications

Embed WireMock.Net directly in test suites (xUnit, NUnit, etc.) to stub external HTTP dependencies and validate client behavior without hitting real services.

Local development and CI/CD test environments

Run as a standalone service or Docker container to provide consistent mock endpoints across development machines and build pipelines, enabling faster feedback loops.

Contract testing and API simulation

Define and simulate RESTful, gRPC, and GraphQL APIs before implementation; use record/playback to generate stubs from real API responses or manually configure complex request-response scenarios.

Implementation considerations

  • Start with the embedded library (WireMock.Net) in unit tests; graduate to WireMock.Net.StandAlone or WireMock.Net.Testcontainers for integration tests or cross-service testing.
  • Use Handlebars templating and conditional proxying to simulate stateful behavior (e.g., API state changes), but test template logic carefully to avoid test brittleness.
  • Multiple NuGet packages exist (WireMock.Net, WireMock.Net.Minimal, WireMock.Net.AspNetCore.Middleware); choose based on your dependency footprint and test framework (xUnit, NUnit, TUnit, etc.).
  • Record/playback feature can seed stubs from real APIs; validate generated stubs manually before committing to test suites to prevent false positives.
  • Configure request matching rules precisely (body patterns, headers, URLs) to avoid over-broad stubs that mask real integration bugs.

When to avoid it — and what to weigh

  • You need production request interception — WireMock.Net is designed for testing and local development, not as a production proxy or gateway; using it in production traffic paths is not a supported use case.
  • Your team uses only non-.NET ecosystems — While it can stub any HTTP endpoint, WireMock.Net is a C# library optimized for .NET applications; Java/Node.js teams should consider the original WireMock or equivalent stubs.
  • You require TLS/mTLS client certificate validation — Not clearly documented in the provided data; verify if certificate pinning, client auth, or advanced SSL scenarios are supported before committing to this tool.
  • You need stateless, low-latency stub matching at extreme scale — WireMock.Net uses in-memory request matching; performance under millions of concurrent stubs or extremely high throughput scenarios is unknown.

License & commercial use

Licensed under Apache License 2.0 (Apache-2.0), a permissive OSI-approved license permitting commercial, private, and derivative use with attribution and liability disclaimers.

Apache-2.0 permits commercial use, including in proprietary products, without royalties. Derivative works must include notice of modifications and a copy of the license. No warranty or indemnity is provided; review your legal team's risk tolerance for third-party library liability in mission-critical testing pipelines.

DEV.co evaluation signals

Editorial assessment — not user reviews. Directional, with an explicit confidence level.

SignalAssessment
MaintenanceActive
DocumentationStrong
License clarityClear
Deployment complexityLow
DEV.co fitStrong
Assessment confidenceHigh
Security considerations

WireMock.Net intercepts and stores HTTP requests and responses for matching and logging; ensure mock instances do not capture or expose real credentials, API keys, or PII in test logs. Use response masking or sanitization if storing sensitive data in stubs. No information provided on encryption at rest, input validation, or vulnerability disclosure process; review source code for sensitive-data handling if using in regulated environments.

Alternatives to consider

WireMock (Java / WireMock Cloud)

Original project with larger ecosystem, browser-based UI, and managed cloud offering; choose if you need platform-agnostic mocking or prefer managed infrastructure.

Moq / NSubstitute (C#)

Lightweight in-process mocking libraries for unit tests; simpler for testing method calls but lack HTTP stubbing, record/playback, and standalone server features.

Prism (Mock Server)

OpenAPI-first mock server with built-in documentation; better if you design APIs with OpenAPI-first discipline and need less .NET-specific integration.

Software development agency

Build on WireMock.Net with DEV.co software developers

Evaluate WireMock.Net for your test suite. Start with the embedded library in xUnit or NUnit, then scale to standalone services or containers. Apache-2.0 licensed and actively maintained.

Talk to DEV.co

Related open-source tools

Surfaced by semantic similarity across the DEV.co open-source index.

WireMock.Net FAQ

Can I use WireMock.Net to mock non-HTTP protocols?
WireMock.Net primarily stubs HTTP responses. It has gRPC/ProtoBuf and WebSockets support documented; GraphQL is supported. Other protocols require custom integration or are out of scope.
Does WireMock.Net persist stubs across restarts?
Stubs are defined programmatically or via JSON files and JSON over HTTP; persistence depends on your deployment model. Embedded instances reset on test cleanup; standalone services require external configuration management.
Is WireMock.Net suitable for performance testing?
WireMock.Net is designed for functional testing and behavior simulation, not load testing. Use it to mock dependencies in load tests, but do not rely on it as a load-testing tool; performance benchmarks under extreme throughput are unknown.
Can I use WireMock.Net in a CI/CD pipeline?
Yes. Use WireMock.Net.StandAlone as a sidecar, WireMock.Net.Testcontainers for container-based CI, or embed in test code. Ensure port conflicts and cleanup are handled properly in parallel test execution.

Custom software development services

Need help beyond evaluating WireMock.Net? DEV.co is a software development agency offering software development services and web development for teams of every size. Our software developers and web developers build custom software, web applications, APIs, and open-source testing integrations — and maintain them long-term.

Ready to Mock HTTP Dependencies in .NET?

Evaluate WireMock.Net for your test suite. Start with the embedded library in xUnit or NUnit, then scale to standalone services or containers. Apache-2.0 licensed and actively maintained.