Ensure MSTest adapter finds TestPlatform framework

This commit is contained in:
Carlos Polop
2026-01-21 12:24:56 +01:00
parent c332fab519
commit 0808fb7f1b
@@ -115,7 +115,6 @@
<Target Name="CopyVSTestFrameworkToMSTestAdapter" AfterTargets="Build"> <Target Name="CopyVSTestFrameworkToMSTestAdapter" AfterTargets="Build">
<PropertyGroup> <PropertyGroup>
<_PackagesDir>$(MSBuildThisFileDirectory)..\packages\</_PackagesDir> <_PackagesDir>$(MSBuildThisFileDirectory)..\packages\</_PackagesDir>
<_MSTestAdapterDir>$(_PackagesDir)MSTest.TestAdapter.2.2.5\build\net45\</_MSTestAdapterDir>
<_MSTestFrameworkDir>$(_PackagesDir)MSTest.TestFramework.2.2.5\lib\net45\</_MSTestFrameworkDir> <_MSTestFrameworkDir>$(_PackagesDir)MSTest.TestFramework.2.2.5\lib\net45\</_MSTestFrameworkDir>
</PropertyGroup> </PropertyGroup>
@@ -123,10 +122,15 @@
<_VSTestFrameworkDlls Include="$(_MSTestFrameworkDir)Microsoft.VisualStudio.TestPlatform.TestFramework*.dll" /> <_VSTestFrameworkDlls Include="$(_MSTestFrameworkDir)Microsoft.VisualStudio.TestPlatform.TestFramework*.dll" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<_MSTestAdapterDirs Include="$(_PackagesDir)MSTest.TestAdapter.2.2.5\build\net45\" Condition="Exists('$(_PackagesDir)MSTest.TestAdapter.2.2.5\build\net45\')" />
<_MSTestAdapterDirs Include="$(_PackagesDir)MSTest.TestAdapter.2.2.5\build\_common\" Condition="Exists('$(_PackagesDir)MSTest.TestAdapter.2.2.5\build\_common\')" />
</ItemGroup>
<Copy <Copy
Condition="Exists('$(_MSTestAdapterDir)') AND @(_VSTestFrameworkDlls) != ''" Condition="@(_VSTestFrameworkDlls) != '' AND @(_MSTestAdapterDirs) != ''"
SourceFiles="@(_VSTestFrameworkDlls)" SourceFiles="@(_VSTestFrameworkDlls)"
DestinationFolder="$(_MSTestAdapterDir)" DestinationFolder="%(_MSTestAdapterDirs.Identity)"
SkipUnchangedFiles="true" /> SkipUnchangedFiles="true" />
</Target> </Target>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />