Microsoft.AspNetCore.Testing 9.6.0

Prefix Reserved
dotnet add package Microsoft.AspNetCore.Testing --version 9.6.0
                    
NuGet\Install-Package Microsoft.AspNetCore.Testing -Version 9.6.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Microsoft.AspNetCore.Testing" Version="9.6.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Microsoft.AspNetCore.Testing" Version="9.6.0" />
                    
Directory.Packages.props
<PackageReference Include="Microsoft.AspNetCore.Testing" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Microsoft.AspNetCore.Testing --version 9.6.0
                    
#r "nuget: Microsoft.AspNetCore.Testing, 9.6.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#addin nuget:?package=Microsoft.AspNetCore.Testing&version=9.6.0
                    
Install Microsoft.AspNetCore.Testing as a Cake Addin
#tool nuget:?package=Microsoft.AspNetCore.Testing&version=9.6.0
                    
Install Microsoft.AspNetCore.Testing as a Cake Tool

Microsoft.AspNetCore.Testing

This package provides test fakes for integration testing of ASP.NET Core applications.

In particular:

  • IWebHostBuilder extensions to setup the test web app.
  • IHost extensions to access that test web app.

Install the package

From the command-line:

dotnet add package Microsoft.AspNetCore.Testing

Or directly in the C# project file:

<ItemGroup>
  <PackageReference Include="Microsoft.AspNetCore.Testing" Version="[CURRENTVERSION]" />
</ItemGroup>

Usage Example

Creating a Test Web App

The IWebHostBuilder extensions can help set up a host for testing.

using var host = await FakeHost.CreateBuilder()
    .ConfigureWebHost(webHost => webHost.UseFakeStartup().ListenHttpOnAnyPort())
    .StartAsync();

Accessing the test Web App

The IHost extensions can help access the test host that was created above.

using var client = host.CreateClient();

var response = await client.GetAsync("/");

Feedback & Contributing

We welcome feedback and contributions in our GitHub repo.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net8.0

    • No dependencies.
  • net9.0

    • No dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Microsoft.AspNetCore.Testing:

Package Downloads
Dazinator.AspNet.Extensions.FileProviders.Tests

Package Description

GitHub repositories (29)

Showing the top 20 popular GitHub repositories that depend on Microsoft.AspNetCore.Testing:

Repository Stars
aspnet/Mvc
[Archived] ASP.NET Core MVC is a model view controller framework for building dynamic web sites with clean separation of concerns, including the merged MVC, Web API, and Web Pages w/ Razor. Project moved to https://github.com/aspnet/AspNetCore
aspnet/KestrelHttpServer
[Archived] A cross platform web server for ASP.NET Core. Project moved to https://github.com/aspnet/AspNetCore
aspnet/SignalR
[Archived] Incredibly simple real-time web for ASP.NET Core. Project moved to https://github.com/aspnet/AspNetCore
aspnet/Identity
[Archived] ASP.NET Core Identity is the membership system for building ASP.NET Core web applications, including membership, login, and user data. Project moved to https://github.com/aspnet/AspNetCore
aspnet/Security
[Archived] Middleware for security and authorization of web apps. Project moved to https://github.com/aspnet/AspNetCore
aspnet/Razor
[Archived] Parser and code generator for CSHTML files used in view pages for MVC web apps. Project moved to https://github.com/aspnet/AspNetCore
aspnet/DependencyInjection
[Archived] Contains common DI abstractions that ASP.NET Core and Entity Framework Core use. Project moved to https://github.com/aspnet/Extensions
aspnet/Entropy
A chaotic experimental playground for new features and ideas - check here for small and simple samples for individual features.
aspnet/Hosting
[Archived] Code for hosting and starting up an ASP.NET Core application. Project moved to https://github.com/aspnet/Extensions and https://github.com/aspnet/AspNetCore
aspnet/Logging
[Archived] Common logging abstractions and a few implementations. Project moved to https://github.com/aspnet/Extensions
aspnet/Caching
[Archived] Libraries for in-memory caching and distributed caching. Project moved to https://github.com/aspnet/Extensions
Azure/azure-signalr
Azure SignalR Service SDK for .NET
aspnet/DotNetTools
[Archived] Various .NET command line tools. Project moved to https://github.com/aspnet/AspNetCore
aspnet/HttpAbstractions
[Archived] HTTP abstractions such as HttpRequest, HttpResponse, and HttpContext, as well as common web utilities. Project moved to https://github.com/aspnet/AspNetCore
aspnet/WebSockets
[Archived] Implementation of the WebSocket protocol, along with client and server integration components.
aspnet/Configuration
[Archived] Interfaces and providers for accessing configuration files. Project moved to https://github.com/aspnet/Extensions
aspnet/Routing
[Archived] Middleware for routing requests to application logic. Project moved to https://github.com/aspnet/AspNetCore
aspnet/HttpClientFactory
[Archived] Contains an opinionated factory for creating HttpClient instances. Project moved to https://github.com/aspnet/Extensions
aspnet/Diagnostics
[Archived] Diagnostics middleware for reporting info and handling exceptions and errors in ASP.NET Core, and diagnosing Entity Framework Core migrations errors. Project moved to https://github.com/aspnet/AspNetCore
aspnet/Templating
[Archived] ASP.NET Core templates for .NET CLI and Visual Studio. Project moved to https://github.com/aspnet/AspNetCore
Version Downloads Last updated
9.6.0 329 6/10/2025
9.5.0 873 5/13/2025
9.4.0 1,091 4/8/2025
9.3.0 1,145 3/11/2025
9.2.0 1,616 2/11/2025
9.1.0 1,950 1/14/2025
9.0.0 1,508 11/12/2024
9.0.0-preview.9.24507.7 196 10/8/2024
9.0.0-preview.8.24460.1 116 9/10/2024
9.0.0-preview.7.24412.10 124 8/14/2024
9.0.0-preview.6.24353.1 95 7/10/2024
9.0.0-preview.5.24311.7 95 6/11/2024
9.0.0-preview.4.24271.2 100 5/21/2024
9.0.0-preview.3.24209.3 453 4/11/2024
9.0.0-preview.2.24157.4 88 3/12/2024
9.0.0-preview.1.24108.1 128 2/13/2024
8.10.0 3,997 10/8/2024
8.9.1 1,785 9/6/2024
8.9.0 161 9/5/2024
8.8.0 2,510 8/13/2024
8.7.0 1,377 7/10/2024
8.6.0 3,449 6/11/2024
8.5.0 1,060 5/14/2024
8.4.0 653 4/9/2024
8.3.0 1,952 3/12/2024
8.2.0 518 2/13/2024
8.1.0 794 1/9/2024
8.0.0 929 11/14/2023
8.0.0-rtm.23558.11 92 11/14/2023
8.0.0-rc.2.23510.2 125 10/10/2023
8.0.0-rc.1.23453.1 216 9/12/2023
8.0.0-preview.7.23407.5 380 8/8/2023