Skip to main content
Testcontainers package icon

Testcontainers

Testcontainers for .NET is a library to support tests with throwaway instances of Docker containers for all compatible .NET Standard versions.

Total Downloads
107.2M
107,173,938
Published
Jun 16, 2024
Latest stable version

Install

.NET CLI
dotnet add package Testcontainers --version 3.9.0
Package Manager Console
Install-Package Testcontainers -Version 3.9.0
PackageReference
<PackageReference Include="Testcontainers" Version="3.9.0" />

Frameworks

net6.0 net8.0 .NETStandard2.0 .NETStandard2.1

Dependencies

[3.125.15, )
[3.125.15, )
SSH.NET
net6.0
[2023.0.0, )
[1.4.2, )
[3.125.15, )
[3.125.15, )
SSH.NET
net8.0
[2023.0.0, )
[1.4.2, )
[2.3.1, )
Docker.DotNet
.NETStandard2.0
[3.125.15, )
Docker.DotNet.X509
.NETStandard2.0
[3.125.15, )
[6.0.0, )
Microsoft.Bcl.HashCode
.NETStandard2.0
[1.1.1, )
SSH.NET
.NETStandard2.0
[2023.0.0, )
SharpZipLib
.NETStandard2.0
[1.4.2, )
System.Text.Json
.NETStandard2.0
[6.0.9, )
[2.3.1, )
Docker.DotNet
.NETStandard2.1
[3.125.15, )
Docker.DotNet.X509
.NETStandard2.1
[3.125.15, )
[6.0.0, )
Microsoft.Bcl.HashCode
.NETStandard2.1
[1.1.1, )
SSH.NET
.NETStandard2.1
[2023.0.0, )
SharpZipLib
.NETStandard2.1
[1.4.2, )
System.Text.Json
.NETStandard2.1
[6.0.9, )

Adoption guide

Teams that need production-like dependency behavior in CI, including version pinning and reproducible startup contracts.

Integration Testing guide
Why it appears in the guide: Provision disposable Docker-based dependencies (databases, brokers, caches) directly from tests. Trade-off: Container startup overhead and host prerequisites require thoughtful fixture reuse and pipeline tuning.

No SPDX license expression is published. Review the license text and your organisation's policy before redistribution.

Compatibility metadata lists 4 target frameworks; confirm the exact target used by your application.

The published metadata declares 28 direct dependency entries across framework groups. Inspect the resolved dependency graph for your target framework.

How to read this guidance

Sources: published NuGet v3 registry metadata and explicit NuBrowse editorial guides. Refresh: package metadata is refreshed from NuGet when the page loads. Limit: this is not a security, legal or compatibility guarantee; validate the selected version in your project.

Useful next steps

Move from package metadata to a concrete selection or review workflow.