I have a .NET 5.0 unit test project that I'm trying to execute via the command line using MSTest.
I'm using a command like the following to run the unit tests:
MSTest.exe /testcontainer:tests\bin\Debug\net5.0\UnitTestProject.dll
But I receive the following error message:
Unable to load the test container 'tests\bin\Debug\net5.0\UnitTestProject.dll'
or one of its dependencies. Error details: System.IO.FileNotFoundException:
Could not load file or assembly 'System.Runtime, Version=5.0.0.0,
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies.
The system cannot find the file specified.
I've seen similar questions on here such as Visual Studio 2017 - Could not load file or assembly 'System.Runtime, Version=4.1.0.0' or one of its dependencies but the answers make reference to editing an app.config file, which I do not have in my project.
Is this just a limitation of using .NET 5.0 and MSTest in the way I'm trying to? Or is there something I can do to allow MSTest to run the tests?