Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Find a way to execute VS 2015 MSTest projects in VS 2017 #108

Closed
jcansdale opened this issue Apr 25, 2018 · 1 comment
Closed

Find a way to execute VS 2015 MSTest projects in VS 2017 #108

jcansdale opened this issue Apr 25, 2018 · 1 comment
Assignees
Labels
Milestone

Comments

@jcansdale
Copy link
Owner

This is a tracking issue to find the best way to execute VS 2015 MSTest projects in VS 2017.

Here is a sample VS 2017 solution that can execute its test using TestDriven.Net or the built in Test Explore. It uses the test runner from VS 2015 (which can be found in the lib\MSTest folder): UnitTestProject2.zip

To convert an existing VS 2017 solution.

  1. Open the NuGet manager and delete the following packages:

image

  1. Copy the lib folder UnitTestProject2.zip to your solution folder.

  2. Add a reference to lib\MSTest\PublicAssemblies\Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll.

You should now be able to execute your tests using either TestDriven.Net or the built in Test Explorer.

Please give this a try and let me know how well it works.

Would it be useful if this was deployed as a NuGet package?

@jcansdale jcansdale self-assigned this Apr 25, 2018
@jcansdale
Copy link
Owner Author

jcansdale commented Apr 29, 2018

I've made some good progress towards adding support for VS 2017 MSTest projects. It seems there are two flavors of MSTest project supported by VS 2017.

The first is where a VS 2017 MSTest project was ported from a VS 2015 solution. In this case the project continues to use the Microsoft.VisualStudio.QualityTools.UnitTestFramework assembly, but the assembly reference is changed to point at the VS 2017 PublicAssemblies folder. For example:
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\PublicAssemblies\

The second flavor is where a new MSTest project is created in VS 2017. In this case the project is created using the MSTest.TestAdapter and MSTest.TestFramework assemblies. The test attributes are split across two assemblies from the MSTest.TestFramework package, Microsoft.VisualStudio.TestPlatform.TestFramework.dll and Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll.

I've added support for the first type and am working on support for the second. It currently works with the new .vsix based installer for TestDriven.Net. I'll back port it so that it will also work with the .exe/.msi based installer.

For the moment, here is a .vsix installer that will allow the execution of MSTest projects in VS 2017 that were ported from VS 2015: TestDriven.VSPackage.zip

@jcansdale jcansdale added this to the v4.3 milestone Jun 14, 2018
@jcansdale jcansdale added this to Done in TestDriven.Net 4.3 Jun 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Development

No branches or pull requests

1 participant