Mobile Monitoring Solutions

Close this search box.

New MSTest SDK: Usage of MSTest Runner Extensions, Support Running Tests in Native AOT

MMS Founder
MMS Robert Krzaczynski

Article originally posted on InfoQ. Visit InfoQ

Microsoft announced the new MSTest SDK built on top of the MSBuild Project SDK system. This SDK improves the experience of testing with MSTest. There are such features as easier usage of MSTest Runner extensions, support running tests in Native AOT mode and better default suggestions. 

To get started with MSTest SDK, it is needed to create a MSTest project (or update an existing one) and replace the content of the .csproj file. It is possible to use any target framework supported by MSTest.


One of the advantages of MSTest SDK is easier usage of MSTest Runner extensions. To help a developer select the right extensions or control updates and alignments between the extensions, Microsoft introduced a new concept of “profiles”. The new SDK provides three profiles: Default, AllMicrosoft and None. 

Using MSTest SDK assures developers that their test project is aligned with the patterns that are provided by the main types of applications such as ASP.NET Core, Razor or Windows Desktop. It will use the default suggestions that the MSTest team makes for the test projects.

Furthermore, MSTest supports running tests in Native AOT mode. When using the MSTest SDK, it will be automatically detected if developers are publishing to AOT. All required test suites and configurations will be transparently changed to fit this specialized mode. More information about testing with Native AOT is available here

Below the official announcement appeared a question if there is an easy way to support running tests both with and without native AOT. Amaury Levé, a senior software engineer at Microsoft, answered: 

Yes. MSTest SDK is the perfect fit for such a use case. By simply providing the PublishAot MSBuild property, we would change all needed references for you. So you can easily do 2 calls to the test execution command (dotnet test, dotnet exec, dotnet run or calling the exe), one with and the other without the property.

Microsoft community also asked about support for testing WASM. Amaury Leve mentioned that there is work on the framework engine and it is in the phase of testing. There is a threat about this topic on GitHub

The MSTest SDK documentation is available on the Microsoft website. 

About the Author

Subscribe for MMS Newsletter

By signing up, you will receive updates about our latest information.

  • This field is for validation purposes and should be left unchanged.