Skip to content

Commit 59f2b40

Browse files
committed
Partial grammar review
1 parent 54e6c11 commit 59f2b40

File tree

8 files changed

+68
-72
lines changed

8 files changed

+68
-72
lines changed

docs/csharp/language-reference/compiler-options/code-generation.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,25 +14,25 @@ helpviewer_keywords:
1414

1515
The following options control compiler inputs. The new MSBuild syntax is shown in **Bold**. The older `csc.exe` syntax is shown in `code style`.
1616

17-
- **DebugType** / `-debug`: Emit (or do not Emit) debugging information.
17+
- **DebugType** / `-debug`: Emit (or don't Emit) debugging information.
1818
- **Optimize** / `-optimize`: Enable optimizations.
1919
- **Deterministic** / `-deterministic`: Produce byte-for-byte equivalent output from the same input source.
2020
- **ProduceOnlyReferenceAssembly** / `-refonly`: Produce a reference assembly, instead of a full assembly, as the primary output.
2121

2222
## DebugType
2323

24-
The **DebugType** option causes the compiler to generate debugging information and place it in the output file or files. This may be affected by the selected build configuration: *Debug* or *Release*.
24+
The **DebugType** option causes the compiler to generate debugging information and place it in the output file or files. Debugging information may be affected by the selected build configuration: *Debug* or *Release*.
2525

2626
```xml
2727
<DebugType>Full</DebugType>
2828
```
2929

30-
The value of this element can be either `full` or `pdbonly`. The *full* argument, which is in effect if you do not specify *pdbonly*, enables attaching a debugger to the running program. Specifying *pdbonly* allows source code debugging when the program is started in the debugger but will only display assembler when the running program is attached to the debugger. Use this option to create debug builds. If **-debug**, **-debug+**, or **-debug:full** is not specified, you will not be able to debug the output file of your program. If you use *full*, be aware that there is some impact on the speed and size of JIT optimized code and a small impact on code quality with *full*. We recommend *pdbonly* or no PDB for generating release code.
30+
The value of this element can be either `full` or `pdbonly`. The *full* argument, which is in effect if you don't specify *pdbonly*, enables attaching a debugger to the running program. Specifying *pdbonly* allows source code debugging when the program is started in the debugger but will only display assembler when the running program is attached to the debugger. Use this option to create debug builds. If **-debug**, **-debug+**, or **-debug:full** isn't specified, you can't debug the output file of your program. If you use *full*, be aware that there's some impact on the speed and size of JIT optimized code and a small impact on code quality with *full*. We recommend *pdbonly* or no PDB for generating release code.
3131

3232
> [!NOTE]
3333
> One difference between *pdbonly* and *full* is that with *full* the compiler emits a <xref:System.Diagnostics.DebuggableAttribute>, which is used to tell the JIT compiler that debug information is available. Therefore, you will get an error if your code contains the <xref:System.Diagnostics.DebuggableAttribute> set to false if you use *full*.
3434
35-
For more information on how to configure the debug performance of an application, see [Making an Image Easier to Debug](../../../framework/debug-trace-profile/making-an-image-easier-to-debug.md). To change the location of the .pdb file, see [**PdbFile**](./advanced.md#pdbfile).
35+
For more information on how to configure the debug performance of an application, see [Making an Image Easier to Debug](../../../framework/debug-trace-profile/making-an-image-easier-to-debug.md). To change the location of the *.pdb* file, see [**PdbFile**](./advanced.md#pdbfile).
3636

3737
## Optimize
3838

@@ -76,7 +76,7 @@ By default, compiler output from a given set of inputs is unique, since the comp
7676
- The Common Language Runtime (CLR) platform on which the compiler is run.
7777
- The value of `%LIBPATH%`, which can affect analyzer dependency loading.
7878

79-
Deterministic compilation can be used for establishing whether a binary is compiled from a trusted source. This can be useful when the source is publicly available. It can also determine whether build steps that are dependent on changes to binary used in the build process.
79+
Deterministic compilation can be used for establishing whether a binary is compiled from a trusted source. Deterministic output can be useful when the source is publicly available. It can also determine whether build steps that are dependent on changes to binary used in the build process.
8080

8181
## ProduceOnlyReferenceAssembly
8282

docs/csharp/language-reference/compiler-options/errors-warnings.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@ The following options control how the compiler reports errors and warnings. The
2929

3030
## TreatWarningsAsErrors
3131

32-
The **TreatWarningsAsErrors** option treats all warnings as errors. You can also use the **WarningsAsError** to set only some warnings as errors. If you turn on **TreatWarningsAsErrors**, you can use **WarningsNotAsError** to list warnings that should not be treated as errors.
32+
The **TreatWarningsAsErrors** option treats all warnings as errors. You can also use the **WarningsAsError** to set only some warnings as errors. If you turn on **TreatWarningsAsErrors**, you can use **WarningsNotAsError** to list warnings that shouldn't be treated as errors.
3333

3434
```xml
3535
<TreatWarningsAsErrors></TreatWarningsAsErrors>
3636
```
3737

38-
Any messages that would ordinarily be reported as warnings are instead reported as errors, and the build process is halted (no output files are built). By default, **TreatWarningsAsErrors** isn't in effect, which means warnings don't prevent the generation of an output file. Optionally, if you want only a few specific warnings to be treated as errors, you may specify a comma-separated list of warning numbers to treat as errors. The set of all nullability warnings can be specified with the **Nullable** shorthand. Use **WarningLevel** to specify the level of warnings that you want the compiler to display. Use **DisabledWarnings** to disable certain warnings.
38+
All warning messages are instead reported as errors. The build process halts (no output files are built). By default, **TreatWarningsAsErrors** isn't in effect, which means warnings don't prevent the generation of an output file. Optionally, if you want only a few specific warnings to be treated as errors, you may specify a comma-separated list of warning numbers to treat as errors. The set of all nullability warnings can be specified with the **Nullable** shorthand. Use **WarningLevel** to specify the level of warnings that you want the compiler to display. Use **DisabledWarnings** to disable certain warnings.
3939

4040
## WarningLevel
4141

@@ -45,7 +45,7 @@ The **WarningLevel** option specifies the warning level for the compiler to disp
4545
<WarningLevel>3</WarningLevel>
4646
```
4747

48-
The element value is the warning level you want displayed for the compilation: Lower numbers show only high severity warnings; higher numbers show more warnings. The value must be zero or a positive integer:
48+
The element value is the warning level you want displayed for the compilation: Lower numbers show only high severity warnings. Higher numbers show more warnings. The value must be zero or a positive integer:
4949

5050
|Warning level|Meaning|
5151
|-------------------|-------------|
@@ -67,7 +67,7 @@ The **DisabledWarnings** option lets you suppress the compiler from displaying o
6767
<DisabledWarnings>number2, number2</DisabledWarnings>
6868
```
6969

70-
`number1`, `number2` Warning number(s) that you want the compiler to suppress. You should only specify the numeric part of the warning identifier. For example, if you want to suppress *CS0028*, you could specify `<DisabledWarnings>28</DisabledWarnings>`. The compiler will silently ignore warning numbers passed to **DisabledWarnings** that were valid in previous releases, but that have been removed from the compiler. For example, *CS0679* was valid in the compiler in Visual Studio .NET 2002 but was subsequently removed.
70+
`number1`, `number2` Warning number(s) that you want the compiler to suppress. You specify the numeric part of the warning identifier. For example, if you want to suppress *CS0028*, you could specify `<DisabledWarnings>28</DisabledWarnings>`. The compiler silently ignores warning numbers passed to **DisabledWarnings** that were valid in previous releases, but that have been removed. For example, *CS0679* was valid in the compiler in Visual Studio .NET 2002 but was removed later.
7171

7272
The following warnings cannot be suppressed by the **DisabledWarnings** option:
7373

@@ -83,7 +83,7 @@ Specify a ruleset file that configures specific diagnostics.
8383
<CodeAnalysisRuleSet>MyConfiguration.ruleset</CodeAnalysisRuleSet>
8484
```
8585

86-
Where `MyConfiguration.ruleset` is the path to the ruleset file. For more information on using rule sets set the article in the [Visual Studio documentation on Rule sets](visualstudio/code-quality/using-rule-sets-to-group-code-analysis-rules).
86+
Where `MyConfiguration.ruleset` is the path to the ruleset file. For more information on using rule sets, see the article in the [Visual Studio documentation on Rule sets](visualstudio/code-quality/using-rule-sets-to-group-code-analysis-rules).
8787

8888
## ErrorLog
8989

@@ -93,7 +93,7 @@ Specify a file to log all compiler and analyzer diagnostics.
9393
<ErrorLog>MyConfiguration.ruleset</ErrorLog>
9494
```
9595

96-
This causes the compiler to output a [Static Analysis Results Interchange Format (SARIF) log](https://github.com/microsoft/sarif-tutorials/blob/main/docs/1-Introduction.md#:~:text=What%20is%20SARIF%3F,for%20use%20by%20simpler%20tools) as a part of the build. SARIF logs are typically read by other tools that analyze the results from compiler and analyzer diagnostics.
96+
The **ErrorLog** option causes the compiler to output a [Static Analysis Results Interchange Format (SARIF) log](https://github.com/microsoft/sarif-tutorials/blob/main/docs/1-Introduction.md#:~:text=What%20is%20SARIF%3F,for%20use%20by%20simpler%20tools). SARIF logs are typically read by tools that analyze the results from compiler and analyzer diagnostics.
9797

9898
## ReportAnalyzer
9999

@@ -103,4 +103,4 @@ Report additional analyzer information, such as execution time.
103103
<ReportAnalyzer>true</ReportAnalyzer>
104104
```
105105

106-
The **ReportAnalyzer** options causes the compiler to emit extra MSBuild log information that details the performance characteristics of analyzers in the build. It is typically used by analyzer authors as part of validating the analyzer.
106+
The **ReportAnalyzer** option causes the compiler to emit extra MSBuild log information that details the performance characteristics of analyzers in the build. It's typically used by analyzer authors as part of validating the analyzer.

docs/csharp/language-reference/compiler-options/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ ms.assetid: d3403556-1816-4546-a782-e8223a772e44
1616

1717
This section describes the options interpreted by the C# compiler. There are two different ways to set compiler options in .NET projects:
1818

19-
- ***Specify option in your \*.csproj file***: You can add XML elements for any compiler option in your *\*.csproj* file. The element name is the same as the compiler option. The value of the XML element sets the value of the compiler option. For more details on setting options in project files see the article [MSBuild properties for .NET SDK Projects](../../../core/project-sdk/msbuild-props.md).
19+
- ***Specify option in your \*.csproj file***: You can add XML elements for any compiler option in your *\*.csproj* file. The element name is the same as the compiler option. The value of the XML element sets the value of the compiler option. For more information on setting options in project files, see the article [MSBuild properties for .NET SDK Projects](../../../core/project-sdk/msbuild-props.md).
2020
- ***Using the Visual Studio Property pages***: Visual Studio provides property pages to edit build properties. You can learn more about them see the article [Manage project and solution properties - Windows](https://docs.microsoft.com/visualstudio/ide/managing-project-and-solution-properties#c-visual-basic-and-f-projects) or [Manage project and solution properties - Mac](https://docs.microsoft.com/visualstudio/mac/managing-solutions-and-project-properties).
2121

2222
## .NET Framework projects

0 commit comments

Comments
 (0)