Skip to content

Commit 80b813d

Browse files
authored
Workaround harmless MSBuild warning in VS (#2350)
1 parent 5660127 commit 80b813d

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/Adapter/Build/Common/MSTest.TestAdapter.targets

+12-1
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,20 @@
3131
(i.e. `<None Remove="@(TestAdapterContent)" />`)
3232
-->
3333
<None Include="@(TestAdapterContent)" />
34-
<Reference Include="Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter" HintPath="$(MSBuildThisFileDirectory)Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.dll" Condition=" '$(EnableMSTestRunner)' == 'true' " />
3534
</ItemGroup>
3635

36+
<Choose>
37+
<!-- Avoid false warning about missing reference (msbuild bug) -->
38+
<!-- https://github.com/dotnet/msbuild/issues/9698#issuecomment-1945763467 -->
39+
<When Condition=" '$(EnableMSTestRunner)' == 'true' ">
40+
<ItemGroup>
41+
<Reference Include="Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter">
42+
<HintPath>$(MSBuildThisFileDirectory)Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.dll</HintPath>
43+
</Reference>
44+
</ItemGroup>
45+
</When>
46+
</Choose>
47+
3748
<Target Name="GetMSTestV2CultureHierarchy">
3849
<!--
3950
Only traversing 5 levels in the culture hierarchy. This is the maximum length for all cultures and should be sufficient

0 commit comments

Comments
 (0)