Microsoft.AspNetCore.Mvc.Testing
10.0.3
Prefix Reserved
See the version list below for details.
dotnet add package Microsoft.AspNetCore.Mvc.Testing --version 10.0.3
NuGet\Install-Package Microsoft.AspNetCore.Mvc.Testing -Version 10.0.3
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="10.0.3" />
<PackageVersion Include="Microsoft.AspNetCore.Mvc.Testing" Version="10.0.3" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" />
paket add Microsoft.AspNetCore.Mvc.Testing --version 10.0.3
#r "nuget: Microsoft.AspNetCore.Mvc.Testing, 10.0.3"
#:package Microsoft.AspNetCore.Mvc.Testing@10.0.3
#addin nuget:?package=Microsoft.AspNetCore.Mvc.Testing&version=10.0.3
#tool nuget:?package=Microsoft.AspNetCore.Mvc.Testing&version=10.0.3
About
Microsoft.AspNetCore.Mvc.Testing provides support for writing integration tests for ASP.NET Core apps that utilize MVC or Minimal APIs.
Key Features
- Copies the dependencies file (
.deps.json) from the System Under Test (SUT) into the test project'sbindirectory - Sets the content root to the SUT's project root so that static files are found during test execution
- Provides the
WebApplicationFactoryclass to streamline bootstrapping the SUT withTestServer
How to Use
To use Microsoft.AspNetCore.Mvc.Testing, follow these steps:
Installation
To install the package, run the following command from the directory containing the test project file:
dotnet add package Microsoft.AspNetCore.Mvc.Testing
Configuration
To configure the test app, follow these steps:
- Specify the Web SDK in the test project file (
<Project Sdk="Microsoft.NET.Sdk.Web">). - Add references to the following packages:
xunitxunit.runner.visualstudioMicrosoft.NET.Test.Sdk
- Add a test class to the test project:
public class BasicTests : IClassFixture<WebApplicationFactory<Program>> { private readonly WebApplicationFactory<Program> _factory; public BasicTests(WebApplicationFactory<Program> factory) { _factory = factory; } [Theory] [InlineData("/")] [InlineData("/Index")] [InlineData("/About")] [InlineData("/Privacy")] [InlineData("/Contact")] public async Task Get_EndpointsReturnSuccessAndCorrectContentType(string url) { // Arrange var client = _factory.CreateClient(); // Act var response = await client.GetAsync(url); // Assert response.EnsureSuccessStatusCode(); // Status Code 200-299 Assert.Equal("text/html; charset=utf-8", response.Content.Headers.ContentType.ToString()); } }
Additional Documentation
For additional documentation and examples, refer to the official documentation on integration testing in ASP.NET Core.
Feedback & Contributing
Microsoft.AspNetCore.Mvc.Testing is released as open-source under the MIT license. Bug reports and contributions are welcome at the GitHub repository.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. 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. |
-
net10.0
- Microsoft.AspNetCore.TestHost (>= 10.0.3)
- Microsoft.Extensions.DependencyModel (>= 10.0.3)
- Microsoft.Extensions.Hosting (>= 10.0.3)
NuGet packages (269)
Showing the top 5 NuGet packages that depend on Microsoft.AspNetCore.Mvc.Testing:
| Package | Downloads |
|---|---|
|
Alba
Supercharged integration testing for ASP.NET Core HTTP endpoints |
|
|
Ardalis.HttpClientTestExtensions
Helpful extension methods to use when testing APIs in Functional Tests with xUnit. |
|
|
MELT.Serilog.AspNetCore
Helper for the MELT testing library to verify that the correct logs are generated by ASP.NET Core applications, when writing integration tests with Microsoft.AspNetCore.Mvc.Testing. |
|
|
FastEndpoints.Testing
Integration/End-To-End testing helper library for FastEndpoints |
|
|
Volo.Abp.AspNetCore.TestBase
Package Description |
GitHub repositories (325)
Showing the top 20 popular GitHub repositories that depend on Microsoft.AspNetCore.Mvc.Testing:
| Repository | Stars |
|---|---|
|
jellyfin/jellyfin
The Free Software Media System - Server Backend & API
|
|
|
microsoft/semantic-kernel
Integrate cutting-edge LLM technology quickly and easily into your apps
|
|
|
bitwarden/server
Bitwarden infrastructure/backend (API, database, Docker, etc).
|
|
|
ardalis/CleanArchitecture
Clean Architecture Solution Template: A proven Clean Architecture Template for ASP.NET Core 10
|
|
|
abpframework/abp
Open-source web application framework for ASP.NET Core! Offers an opinionated architecture to build enterprise software solutions with best practices on top of the .NET. Provides the fundamental infrastructure, cross-cutting-concern implementations, startup templates, application modules, UI themes, tooling and documentation.
|
|
|
dotnet/AspNetCore.Docs
Documentation for ASP.NET Core
|
|
|
aspnetboilerplate/aspnetboilerplate
ASP.NET Boilerplate - Web Application Framework
|
|
|
dotnet-architecture/eShopOnWeb
Sample ASP.NET Core 8.0 reference application, now community supported: https://github.com/NimblePros/eShopOnWeb
|
|
|
dodyg/practical-aspnetcore
Practical samples of ASP.NET Core 10, 9, 8.0, 7.0, 6.0, 5.0, 3.1, 2.2, and 2.1,projects you can use. Readme contains explanations on all projects.
|
|
|
dotnet/eShop
A reference .NET application implementing an eCommerce site
|
|
|
OrchardCMS/OrchardCore
Orchard Core is an open-source modular and multi-tenant application framework built with ASP.NET Core, and a content management system (CMS) built on top of that framework.
|
|
|
elsa-workflows/elsa-core
The Workflow Engine for .NET
|
|
|
quartznet/quartznet
Quartz Enterprise Scheduler .NET
|
|
|
graphql-dotnet/graphql-dotnet
GraphQL for .NET
|
|
|
Azure/azure-sdk-for-net
This repository is for active development of the Azure SDK for .NET. For consumers of the SDK we recommend visiting our public developer docs at https://learn.microsoft.com/dotnet/azure/ or our versioned developer docs at https://azure.github.io/azure-sdk-for-net.
|
|
|
FastEndpoints/FastEndpoints
A light-weight REST API development framework for ASP.NET 8 and newer.
|
|
|
kurrent-io/KurrentDB
KurrentDB is a database that's engineered for modern software applications and event-driven architectures. Its event-native design simplifies data modeling and preserves data integrity while the integrated streaming engine solves distributed messaging challenges and ensures data consistency.
|
|
|
domaindrivendev/Swashbuckle.AspNetCore
Swagger tools for documenting API's built on ASP.NET Core
|
|
|
umbraco/Umbraco-CMS
Umbraco is a free and open source .NET content management system helping you deliver delightful digital experiences.
|
|
|
jasontaylordev/NorthwindTraders
Northwind Traders is a sample application built using ASP.NET Core and Entity Framework Core.
|
| Version | Downloads | Last Updated |
|---|---|---|
| 11.0.0-preview.1.26104.118 | 774 | 2/10/2026 |
| 10.0.3 | 139,666 | 2/10/2026 |
| 10.0.2 | 1,289,441 | 1/13/2026 |
| 10.0.1 | 1,349,766 | 12/9/2025 |
| 10.0.0 | 1,678,862 | 11/11/2025 |
| 10.0.0-rc.2.25502.107 | 53,950 | 10/14/2025 |
| 10.0.0-rc.1.25451.107 | 57,688 | 9/9/2025 |
| 10.0.0-preview.7.25380.108 | 26,805 | 8/12/2025 |
| 9.0.13 | 17,424 | 2/10/2026 |
| 9.0.12 | 189,235 | 1/13/2026 |
| 9.0.11 | 943,891 | 11/11/2025 |
| 9.0.10 | 1,871,681 | 10/14/2025 |
| 9.0.9 | 2,130,743 | 9/9/2025 |
| 8.0.24 | 33,829 | 2/10/2026 |
| 8.0.23 | 326,527 | 1/13/2026 |
| 8.0.22 | 1,562,971 | 11/11/2025 |
| 8.0.21 | 1,338,043 | 10/14/2025 |
| 8.0.20 | 1,266,909 | 9/9/2025 |
| 2.3.9 | 5,787 | 1/7/2026 |
| 2.3.8 | 685 | 1/7/2026 |