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


  • GitHub Copilot for Azure Gets Preview Glitches

    This reporter, recently accepted to preview GitHub Copilot for Azure, has thus far found the tool to be, well, glitchy.

  • New .NET 9 Templates for Blazor Hybrid, .NET MAUI

    Microsoft's fifth preview of .NET 9 nods at AI development while also introducing new templates for some of the more popular project types, including Blazor Hybrid and .NET MAUI.

  • What's Next for ASP.NET Core and Blazor

    Since its inception as an intriguing experiment in leveraging WebAssembly to enable dynamic web development with C#, Blazor has evolved into a mature, fully featured framework. Integral to the ASP.NET Core ecosystem, Blazor offers developers a unique combination of server-side rendering and rich client-side interactivity.

  • Nearest Centroid Classification for Numeric Data Using C#

    Here's a complete end-to-end demo of what Dr. James McCaffrey of Microsoft Research says is arguably the simplest possible classification technique.

  • .NET MAUI in VS Code Goes GA

    Visual Studio Code's .NET MAUI workload, which evolves the former Xamarin.Forms mobile-centric framework by adding support for creating desktop applications, has reached general availability.

Subscribe on YouTube