Repository navigation
Support selected .NET 11 SDK features and document support decisions - #560
Merged
Merged
Conversation
Add solution filters, Run environment variables, Format framework selection, prerelease template installs, and SDK-aware test runner detection. Preserve existing defaults and document verified RC3 behavior. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
| { | ||
| foreach (var (prerelease, explicitVersion, expected) in new[] | ||
| { | ||
| (false, (string?)null, "1.0.0"), |
| foreach (var (prerelease, explicitVersion, expected) in new[] | ||
| { | ||
| (false, (string?)null, "1.0.0"), | ||
| (true, (string?)null, "2.0.0-preview.1"), |
| { | ||
| (false, (string?)null, "1.0.0"), | ||
| (true, (string?)null, "2.0.0-preview.1"), | ||
| (true, (string?)"1.0.0", "1.0.0") |
Comment on lines
+1314
to
+1316
| (effectiveRunner, selectionSource) = SdkIntegration.TestRunnerDetector.DetectTestRunner( | ||
| workingDirectory: projectDir, projectPath: project, logger: _logger, | ||
| supportsEnvironmentRunner: supportsEnvironmentRunner); |
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Concurrent filter removals can silently overwrite each other, and environment secrets can leak through logs and returned commands even when unsafe output is disabled.
4 open issues
What changed in this PR
Adds selected .NET 11 SDK capabilities to the existing MCP tools while preserving defaults and documenting deferred work from #547.
Changes:
- Adds explicit solution-filter creation and membership management.
- Exposes Run environment variables, Format framework selection, prerelease template installation, and SDK-aware test-runner precedence.
- Adds feature, schema, and stdio scenario tests, plus usage and support-decision documentation.
| File | Description |
|---|---|
| README.md | Documents new options, compatibility, and examples. |
| DotNetMcp/Tools/Sdk/DotNetCliTools.Sdk.Consolidated.cs | Adds prerelease template installation. |
| DotNetMcp/Tools/Cli/DotNetCliTools.Solution.cs | Adds solution filters and JSON-based membership removal. |
| DotNetMcp/Tools/Cli/DotNetCliTools.Project.Consolidated.cs | Routes new project options and test-runner overrides. |
| DotNetMcp/Tools/Cli/DotNetCliTools.Misc.cs | Adds framework selection to Format. |
| DotNetMcp/SdkIntegration/TestRunnerDetector.cs | Adds environment-based runner detection. |
| DotNetMcp/Execution/SdkFeatureSupport.cs | Checks active SDK support for opt-ins. |
| DotNetMcp/Execution/DotNetCommandExecutor.cs | Applies child-process test-runner overrides. |
| DotNetMcp/Execution/CommandLineArgument.cs | Adds command-argument quoting. |
| DotNetMcp.Tests/Tools/Sdk11FeatureTests.cs | Tests features and compatibility behavior. |
| DotNetMcp.Tests/Server/ToolAnnotationTests.cs | Checks discovery metadata for new parameters. |
| DotNetMcp.Tests/Scenarios/Sdk11FeatureScenarioTests.cs | Adds stdio scenarios for templates, Run, and filters. |
| doc/sdk-integration.md | Explains SDK gating, implementation choices, and deferred work. |
| doc/error-diagnostics.md | Documents NETSDK1235 warning behavior. |
| doc/ai-assistant-guide.md | Maps supported features to MCP arguments. |
Review effort: Balanced
| if (noBuild) args.Append(" --no-build"); | ||
| if (environmentVariables is not null) | ||
| foreach (var (name, value) in environmentVariables) | ||
| args.Append($" --environment {CommandLineArgument.Quote($"{name}={value}")}"); |
Comment on lines
+192
to
+195
| if (await File.ReadAllTextAsync(filterPath, cancellationToken) != originalContent) | ||
| return "Error: The solution filter changed during removal. No changes were made; retry with the current file."; | ||
| cancellationToken.ThrowIfCancellationRequested(); | ||
| File.Replace(temporaryPath, filterPath, destinationBackupFileName: null); |
| if (includeGenerated) args.Append(" --include-generated"); | ||
| if (!string.IsNullOrEmpty(diagnostics)) args.Append($" --diagnostics {diagnostics}"); | ||
| if (!string.IsNullOrEmpty(severity)) args.Append($" --severity {severity}"); | ||
| if (!string.IsNullOrEmpty(framework)) args.Append($" --framework {framework}"); |
Comment on lines
+1264
to
+1266
| var (major, sdkError) = await SdkFeatureSupport.GetMajorVersionAsync(_logger); | ||
| if (sdkError is not null) | ||
| return sdkError; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Why
.NET 11 adds useful CLI capabilities that the existing MCP tools do not expose. This completes the evaluation epic with a bounded set of low-cost additions, preserves existing defaults, and tracks larger feature work separately.
Fixes: #547
Approach
.slnformat.DOTNET_TEST_RUNNERprecedence and keep explicit runner overrides local to the child process. Check the active CLI SDK rather than the server's target framework.Follow-up implementation issues: test controls/artifacts (#557), file-based apps (#558), watch/device/Aspire lifecycle (#559), and NuGet source publication-age policy (#556). The full feature decision record is attached to #547.
SDK-specific considerations
RC3's filter Remove command can exit successfully without removing entries when the filter and parent are in different directories. Filter removal therefore validates and updates JSON membership directly, preserves unrelated properties, retains confirmation, and uses an adjacent temporary file plus atomic replacement.
RC3's MTP test templates reject an explicit
net10.0target despite advertising it in help. Examples explicitly selectnet11.0and explain that template post-actions can updateglobal.jsoneven with--no-restore.Validation
net10.0andnet11.0server targets build with zero warnings/errors.No dependency upgrades or tool-manifest changes.