Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

display options control in table #43946

Merged
merged 2 commits into from
Dec 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,19 @@ 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) |

timdeschryver marked this conversation as resolved.
Show resolved Hide resolved
> [!NOTE]
> Refer to [Compiler options](index.md#how-to-set-options) for more information on configuring these options for your project.
Expand Down
Loading