MSTest Framework Support in .NET/ASP.NET 1.0 Core RC 2

To smoothen the testing process for .NET Core 1.0 and ASP.NET Core 1.0 deployments, the Visual Studio team has released a preview of its MSTest Framework that supports the RC versions.

Microsoft's Visual Studio team has released a version of the MSTest Framework that now supports the RC2 versions of .NET Core and ASP.NET Core that were released recently. It's in preview at this point, so treat it accordingly (that is, don't assume it's ready for production use quite yet until you've done your own testing on your systems).

The MSTest Framework is Microsoft's framework developed for unit testing, and competes with third-party testing tools like the popular NUnit and xUnit. Some developers prefer MSTest because of its direct integration with Visual Studio and .NET Framework. MSTest is available on NuGet here.

A blog posted by Microsoft's Pratap Lakshman describes the process for using it, which involves installing the SDK, creating a class library project, adding references to MSTest in the runner and project.json file, and then writing and running tests. He writes that MSTest can also be used to test desktop .NET, which requires a slight change to the project.json file to reference it.

A few developers noted that tests didn't show up in the test runner when running MStest. The capitalization is key. As commenter Kris notes, "the value provided for 'testRunner' is 'MSTest', which apparently gets concatenated into dotnet-test-MSTest. However, if you look in your C:\Users\{username}\.nuget\packages\dotnet-test-mstest\1.0.0-preview\lib\net451 — you'll see the executable is dotnet-test-mstest." Lakshman verifies that to be the case (no pun intended).

Lakshman, in response to another commenter, notes that MStest also can be used with UWP. He replies that it essentially is a matter of replacing "Microsoft.VisualStudio.TestPlatform.UnitTestFramework;" with "Microsoft.VisualStudio.TestTools.UnitTesting;" in a unit test app template. Laksham said that he'll be following up with a more comprehensive post describing the process at a later time.

About the Author

Michael Domingo is a long-time software publishing veteran, having started up and managed several developer publications for the Clipper compiler, Microsoft Access, and Visual Basic. He's also managed IT pubs for 1105 Media, including Microsoft Certified Professional Magazine and Virtualization Review before landing his current gig as Visual Studio Magazine Editor in Chief. Besides his publishing life, he's a professional photographer, whose work can be found by Googling domingophoto.

comments powered by Disqus


  • Death of the Dev Machine?

    Here's a takeaway from this week's Ignite 2020 event: An advanced Azure cloud portends the death of the traditional, high-powered dev machine packed with computing, memory and storage components.

  • COVID-19 Is Ignite 2020's Elephant in the Room: 'Frankly, It Sucks'

    As in all things of our new reality, there was no escaping the drastic changes in routine caused by the COVID-19 pandemic during Microsoft's big Ignite 2020 developer/IT pro conference, this week shifted to an online-only event after drawing tens of thousands of in-person attendees in years past.

  • Visual Studio 2019 v16.8 Preview Update Adds Codespaces

    To coincide with the Microsoft Ignite 2020 IT pro/developer event, the Visual Studio dev team shipped a new update, Visual Studio 2019 v16.8 Preview 3.1, with the main attraction being support for cloud-hosted Codespaces, now in a limited beta.

  • Speed Lines Graphic

    New for Blazor: Azure Static Web Apps Support

    With Blazor taking the .NET web development world by storm, one of the first announcements during Microsoft's Ignite 2020 developer/IT event was its new support in Azure Static Web Apps.

  • Entity Framework Core 5 RC1 Is Feature Complete, Ready for Production

    The first release candidate for Entity Framework 5 -- Microsoft's object-database mapper for .NET -- has shipped with a go live license, ready for production.

Upcoming Events