I'm converting some existing C# projects to be defined in CMake -- moving from the previous include_external_msproject()
directive to the newer full support for C#.
But I'm not seeing how to convert projects of the Visual C# Unit Test Project
type. I'm able to build them as libraries, and compile them successfully -- but Visual Studio doesn't show them as unit test projects, just as regular libraries. Most crucially, the tests aren't visible to the Test Explorer.
Things I've already tried include:
- Adding
TestProjectType=UnitTest
as a target property:
<TestProjectType>UnitTest</TestProjectType>
- Adding a reference path, as follows, as a target property:
<ReferencePath>$(ProgramFiles)/Common Files/microsoft shared/VSTT/$(VisualStudioVersion)/UITestExtensionPackages</ReferencePath>
- Adding
Microsoft.VisualStudio.QualityTools.UnitTestFramework
as a project reference (using CMake'sVS_DOTNET_REFERENCES
property).
I'm using Microsoft Visual Studio Professional 2015, CMake 3.13.2, .NET Framework 4.5.2 (but I suspect the issue isn't specific to my particular version combination).