Skip to content

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Aug 5, 2025

This PR verifies the resolution of issue #34900 regarding incorrect C# compiler option documentation for warning-related flags.

Issue Analysis

The original issue reported that the documentation incorrectly showed:

  • WarningsAsErrors mapped to -warnaserror (should be -warnaserror+)
  • WarningsNotAsErrors mapped to -warnnotaserror (should be -warnaserror-)

The issue also noted that MSBuild supports -warnNotAsError but the documentation should show csc.exe options rather than MSBuild options.

Current State

Upon investigation, the documentation in docs/csharp/language-reference/compiler-options/errors-warnings.md already shows the correct syntax:

MSBuild syntax csc.exe syntax Description
TreatWarningsAsErrors -warnaserror Treat all warnings as errors
WarningsAsErrors -warnaserror+ Treat one or more warnings as errors
WarningsNotAsErrors -warnaserror- Treat one or more warnings not as errors

Verification Results

  • ✅ No instances of the incorrect -warnnotaserror syntax found in the codebase
  • ✅ Correct -warnaserror+ and -warnaserror- syntax already documented
  • ✅ Table properly separates MSBuild syntax from csc.exe syntax as requested in the issue
  • ✅ All cross-references throughout the documentation are consistent
  • ✅ Markdown linting passes with no errors

The issue appears to have been resolved at some point after it was filed in April 2023. The documentation now correctly shows the csc.exe compiler options exactly as requested in the original issue.

Fixes #34900.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@dotnet-policy-service dotnet-policy-service bot added the okr-quality Content-quality KR: Concerns article defects (bugs), freshness, or build warnings. label Aug 5, 2025
@Copilot Copilot AI changed the title [WIP] Roslyn does not support csc -warnnotaserror Verify C# compiler options documentation - issue already resolved Aug 5, 2025
@Copilot Copilot AI requested a review from BillWagner August 5, 2025 17:26
Copilot finished work on behalf of BillWagner August 5, 2025 17:26
@BillWagner BillWagner closed this Aug 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

okr-quality Content-quality KR: Concerns article defects (bugs), freshness, or build warnings.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Roslyn does not support csc -warnnotaserror

2 participants