Skip to content

Commit db11c07

Browse files
Remove platform-specific DefaultTestTargetFrameworks and apply SetTargetFramework to all platforms
- Removed conditional net472 addition to DefaultTestTargetFrameworks on Windows - Changed SetTargetFramework to apply to all platforms (not just non-Windows) - Now all platforms test net10.0, net9.0, and net8.0, with net8.0 using netstandard2.0 build - This provides consistent netstandard2.0 test coverage across all platforms Co-authored-by: eiriktsarpalis <2813363+eiriktsarpalis@users.noreply.github.com>
1 parent 753cc88 commit db11c07

2 files changed

Lines changed: 3 additions & 4 deletions

File tree

Directory.Build.props

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,7 @@
4747
</PropertyGroup>
4848

4949
<PropertyGroup>
50-
<!-- Shared target frameworks for test projects and test support projects. net472 is only included on Windows. -->
50+
<!-- Shared target frameworks for test projects and test support projects. -->
5151
<DefaultTestTargetFrameworks>net10.0;net9.0;net8.0</DefaultTestTargetFrameworks>
52-
<DefaultTestTargetFrameworks Condition="$([MSBuild]::IsOSPlatform('Windows'))">$(DefaultTestTargetFrameworks);net472</DefaultTestTargetFrameworks>
5352
</PropertyGroup>
5453
</Project>

tests/ModelContextProtocol.Tests/ModelContextProtocol.Tests.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@
7979

8080
<ItemGroup>
8181
<ProjectReference Include="..\..\src\ModelContextProtocol.Core\ModelContextProtocol.Core.csproj">
82-
<!-- On non-Windows platforms, force net8.0 tests to use netstandard2.0 build for cross-platform netstandard2.0 coverage -->
83-
<SetTargetFramework Condition="'$(TargetFramework)' == 'net8.0' AND !$([MSBuild]::IsOSPlatform('Windows'))">TargetFramework=netstandard2.0</SetTargetFramework>
82+
<!-- Force net8.0 tests to use netstandard2.0 build for netstandard2.0 test coverage on all platforms -->
83+
<SetTargetFramework Condition="'$(TargetFramework)' == 'net8.0'">TargetFramework=netstandard2.0</SetTargetFramework>
8484
</ProjectReference>
8585
<ProjectReference Include="..\ModelContextProtocol.TestServer\ModelContextProtocol.TestServer.csproj" />
8686
<ProjectReference Include="..\..\samples\TestServerWithHosting\TestServerWithHosting.csproj" />

0 commit comments

Comments
 (0)