Microsoft Dev Blogs

MSTest SDK:.NET 8的测试配置与灵活性新篇

thumbnail

Introduction

The new MSTest SDK, built on the MSBuild Project SDK system, aims to make project configuration easier with reasonable defaults and flexible options, providing a better MSTest testing experience.

Getting Started

To start using the MSTest SDK, simply create a new MSTest project (or update an existing one) and replace the contents of the .csproj file with the provided template.

Advantages of MSTest SDK

  • Better default values
  • Simplified extensibility with MSTest runner
  • Easier selection of new features (e.g., native AOT testing)

Better Default Values

The MSTest SDK aligns with patterns provided by major types of applications and uses default recommendations provided by the MSTest team.

Easier Use of MSTest Runner Extensions

By introducing the concept of "configuration files" with options like Default, AllMicrosoft, and None, users can easily select and customize extensions to enhance their testing experience.

Testing Native AOT

MSTest is the first .NET testing framework and runner to support running tests in Native AOT mode, automatically detecting if AOT deployment is needed when using MSTest SDK.

Next Steps

The MSTest SDK style is still in development but is already becoming the cornerstone of upcoming enhancements and features. Users are highly recommended to transition to this SDK style, which will be the standard for MSTest project templates using .NET 9.

Feedback

Feedback on further improvements and enhancements to the MSTest SDK is welcome to ensure it meets user needs and expectations. The best way to share feedback is by reporting issues in the microsoft/testfx repository.