From b39c8752fcd1eab8d48cf9b0060a762e4c03716e Mon Sep 17 00:00:00 2001 From: Tim Deschryver <28659384+timdeschryver@users.noreply.github.com> Date: Wed, 11 Dec 2024 19:30:58 +0100 Subject: [PATCH 1/2] display options control in table --- .../compiler-options/errors-warnings.md | 25 +++++++++++-------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/docs/csharp/language-reference/compiler-options/errors-warnings.md b/docs/csharp/language-reference/compiler-options/errors-warnings.md index 179bab85ac357..1965b0d15d3c9 100644 --- a/docs/csharp/language-reference/compiler-options/errors-warnings.md +++ b/docs/csharp/language-reference/compiler-options/errors-warnings.md @@ -16,17 +16,20 @@ helpviewer_keywords: --- # C# Compiler Options to report errors and warnings -The following options control how the compiler reports errors and warnings. The new MSBuild syntax is shown in **Bold**. The older *csc.exe* syntax is shown in `code style`. - -- **WarningLevel** / `-warn`: Set warning level. -- **AnalysisLevel**: Set optional warning level. -- **TreatWarningsAsErrors** / `-warnaserror`: Treat all warnings as errors -- **WarningsAsErrors** / `-warnaserror`: Treat one or more warnings as errors -- **WarningsNotAsErrors** / `-warnnotaserror`: Treat one or more warnings not as errors -- **NoWarn** / `-nowarn`: Set a list of disabled warnings. -- **CodeAnalysisRuleSet** / `-ruleset`: Specify a ruleset file that disables specific diagnostics. -- **ErrorLog** / `-errorlog`: Specify a file to log all compiler and analyzer diagnostics. -- **ReportAnalyzer** / `-reportanalyzer`: Report additional analyzer information, such as execution time. +The following options control how the compiler reports errors and warnings. + +| MSBuild syntax | _csc.exe_ syntax | Description | +| ----------------------- | ----------------- | ------------------------------------------------------------------------------------------------- | +| `WarningLevel` | `-warn` | Set warning level. [More info.](#warninglevel) | +| `AnalysisLevel` | / | Set optional warning level. [More info.](#analysis-level) | +| `TreatWarningsAsErrors` | `-warnaserror` | Treat all warnings as errors. [More info.](#treatwarningsaserrors) | +| `WarningsAsErrors` | `-warnaserror` | Treat one or more warnings as errors. [More info.](#warningsaserrors-and-warningsnotaserrors) | +| `WarningsNotAsErrors` | `-warnnotaserror` | Treat one or more warnings not as errors. [More info.](#warningsaserrors-and-warningsnotaserrors) | +| `NoWarn` | `-nowarn` | Set a list of disabled warnings. [More info.](#nowarn) | +| `CodeAnalysisRuleSet` | `-ruleset` | Specify a ruleset file that disables specific diagnostics. [More info.](#codeanalysisruleset) | +| `ErrorLog` | `-errorlog` | Specify a file to log all compiler and analyzer diagnostics. [More info.](#errorlog) | +| `ReportAnalyzer` | `-reportanalyzer` | Report additional analyzer information, such as execution time. [More info.](#reportanalyzer) | + > [!NOTE] > Refer to [Compiler options](index.md#how-to-set-options) for more information on configuring these options for your project. From 3e0e11d846f4fe1f750cab471af5e30eb05dc108 Mon Sep 17 00:00:00 2001 From: Tim Deschryver <28659384+timdeschryver@users.noreply.github.com> Date: Thu, 12 Dec 2024 16:11:40 +0100 Subject: [PATCH 2/2] Update docs/csharp/language-reference/compiler-options/errors-warnings.md --- .../language-reference/compiler-options/errors-warnings.md | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/csharp/language-reference/compiler-options/errors-warnings.md b/docs/csharp/language-reference/compiler-options/errors-warnings.md index 1965b0d15d3c9..80e6f18dbe58c 100644 --- a/docs/csharp/language-reference/compiler-options/errors-warnings.md +++ b/docs/csharp/language-reference/compiler-options/errors-warnings.md @@ -30,7 +30,6 @@ The following options control how the compiler reports errors and warnings. | `ErrorLog` | `-errorlog` | Specify a file to log all compiler and analyzer diagnostics. [More info.](#errorlog) | | `ReportAnalyzer` | `-reportanalyzer` | Report additional analyzer information, such as execution time. [More info.](#reportanalyzer) | - > [!NOTE] > Refer to [Compiler options](index.md#how-to-set-options) for more information on configuring these options for your project.