You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This test project provides cross-platform testing of the `netstandard2.0` build of `ModelContextProtocol.Core`.
4
+
5
+
## Purpose
6
+
7
+
The main test project (`ModelContextProtocol.Tests`) targets multiple frameworks including `net472`, which only runs on Windows. This creates a gap for developers on non-Windows platforms who want to test the `netstandard2.0` build.
8
+
9
+
This project solves that by:
10
+
1. Targeting `net8.0` (stable, cross-platform)
11
+
2. Forcing `ModelContextProtocol.Core` to use its `netstandard2.0` build via `SetTargetFramework`
12
+
3. Including all test source files from the main test project
13
+
14
+
## Key Features
15
+
16
+
-**Cross-platform**: Runs on Windows, Linux, and macOS using the modern .NET runtime
17
+
-**netstandard2.0 testing**: Verifies the netstandard2.0 build without requiring .NET Framework or mono
18
+
-**Shared tests**: Uses the same test source files as `ModelContextProtocol.Tests` to ensure consistency
19
+
20
+
## How It Works
21
+
22
+
The project uses the MSBuild `SetTargetFramework` property on the project reference to force the referenced project to build for a specific target framework:
This allows the test project (targeting `net8.0`) to reference and test the `netstandard2.0` build of `ModelContextProtocol.Core`.
31
+
32
+
## Running Tests
33
+
34
+
```bash
35
+
# Run all tests
36
+
dotnet test tests/ModelContextProtocol.Netstandard2_0.Tests
37
+
38
+
# Run with filter
39
+
dotnet test tests/ModelContextProtocol.Netstandard2_0.Tests --filter '(Execution!=Manual)'
40
+
```
41
+
42
+
## Reference
43
+
44
+
This pattern is based on the approach used by [googleapis/dotnet-genai](https://github.com/googleapis/dotnet-genai/blob/f0d9a3eb970e91293b806dac49853b68e4ddcdca/Google.GenAI.Tests/Netstandard2_0Tests/Google.GenAI.Netstandard2_0.Tests.csproj).
0 commit comments