Skip to content

Commit 70bb372

Browse files
Don't run net4x tests with Mono on non-Windows (#98767)
* Don't run net4x tests with Mono on non-Windows We'd try to use Mono to run them but most of the tests assume Windows when targetting net4x so they don't work anyway and you'd need to remember to pass the `-f net9.0` TFM filter. Instead just skip them on non-Windows platforms. Fixes #81395 * Make AdditionalProperties more resilient against changes * Use TargetOS instead of OS so it also works for building e.g. Browser targets on Windows * Move logic to arcade Microsoft.DotNet.Build.Tasks * Update eng/testing/outerBuild.targets Co-authored-by: Viktor Hofer <viktor.hofer@microsoft.com> --------- Co-authored-by: Viktor Hofer <viktor.hofer@microsoft.com>
1 parent 2ab51c6 commit 70bb372

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

eng/testing/outerBuild.targets

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,19 @@
11
<Project>
2-
<Target Name="Test" DependsOnTargets="GetProjectWithBestTargetFrameworks">
2+
<Target Name="Test" DependsOnTargets="RemoveNetFrameworkProjectsOnNonWindows;GetProjectWithBestTargetFrameworks">
33
<MSBuild Projects="@(InnerBuildProjectsWithBestTargetFramework)"
44
Targets="Test">
55
</MSBuild>
66
</Target>
7-
<Target Name="VSTest" DependsOnTargets="GetProjectWithBestTargetFrameworks">
7+
<!-- Manually remove .NET Framework projects on non-Windows: https://github.com/microsoft/vstest/issues/4908 -->
8+
<Target Name="VSTest" DependsOnTargets="RemoveNetFrameworkProjectsOnNonWindows;GetProjectWithBestTargetFrameworks">
89
<MSBuild Projects="@(InnerBuildProjectsWithBestTargetFramework)"
910
Targets="VSTest">
1011
</MSBuild>
1112
</Target>
13+
<Target Name="RemoveNetFrameworkProjectsOnNonWindows" Condition="'$(TargetOS)' != 'windows'">
14+
<PropertyGroup>
15+
<!-- we'd try to run tests with Mono for netfx projects which doesn't work so filter them out -->
16+
<IncludeNetFrameworkTfms>false</IncludeNetFrameworkTfms>
17+
</PropertyGroup>
18+
</Target>
1219
</Project>

0 commit comments

Comments
 (0)