.NET: Address Suppress Experimental Features for Docker Build#4641
Merged
rogerbarreto merged 2 commits intomicrosoft:mainfrom Mar 13, 2026
Merged
Conversation
…I warnings Add #pragma warning disable directives to suppress experimental API diagnostics that cause build errors in Docker isolation (where repo-level Directory.Build.props is not inherited): - AgentWithHostedMCP: suppress MEAI001 (HostedMcpServerTool) and OPENAI001 (GetResponsesClient) - FoundrySingleAgent: suppress CA2252 (AIProjectClient preview features) - FoundryMultiAgent: suppress CA2252 (AIProjectClient preview features) Fixes microsoft#4365
…nto issues/4365-deploy-agent-hosted-mcp
Contributor
There was a problem hiding this comment.
Pull request overview
Suppresses preview/experimental analyzer warnings in .NET hosted-agent samples so Docker builds (and other warnings-as-errors builds) succeed, addressing deployment failures for AgentWithHostedMCP.
Changes:
- Disable CA2252 in Foundry hosted-agent samples that use preview
AIProjectClient/Agents APIs. - Disable experimental diagnostics (MEAI001, OPENAI001) in
AgentWithHostedMCPfor Hosted MCP tooling and Responses client usage.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| dotnet/samples/05-end-to-end/HostedAgents/FoundrySingleAgent/Program.cs | Suppresses CA2252 preview-feature warning so the sample builds under warnings-as-errors. |
| dotnet/samples/05-end-to-end/HostedAgents/FoundryMultiAgent/Program.cs | Suppresses CA2252 preview-feature warning so the sample builds under warnings-as-errors. |
| dotnet/samples/05-end-to-end/HostedAgents/AgentWithHostedMCP/Program.cs | Suppresses MEAI001/OPENAI001 experimental warnings so the sample builds under warnings-as-errors. |
SergeyMenshykh
approved these changes
Mar 12, 2026
westey-m
approved these changes
Mar 12, 2026
This was referenced Apr 3, 2026
This was referenced Apr 6, 2026
Merged
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.
Motivation and Context
AgentWithHostedMCP#4365