Skip to content

Commit a715096

Browse files
CopilotBillWagner
andauthored
Add build-only diagnostic note to CS0169 documentation (#47309)
* Initial plan * Add build-only diagnostic note to CS0169 documentation Co-authored-by: BillWagner <[email protected]> * Add build-only diagnostic note to all relevant CS error documentation Co-authored-by: BillWagner <[email protected]> * Add build-only diagnostic note to remaining CS error documentation files Co-authored-by: BillWagner <[email protected]> --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: BillWagner <[email protected]>
1 parent 7f9015f commit a715096

File tree

19 files changed

+47
-9
lines changed

19 files changed

+47
-9
lines changed

docs/csharp/language-reference/compiler-messages/cs0518.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ ms.assetid: b0b61cbb-c9a7-48c9-9e60-7cdd5ecb3e6c
1212

1313
Predefined type 'type' is not defined or imported
1414

15-
The main cause for this problem is that the project is not importing mscorlib.dll, which defines the entire System namespace. This can be caused by one of the following:
15+
The main cause for this problem is that the project is not importing mscorlib.dll, which defines the entire System namespace. This can be caused by one of the following:
16+
17+
[!INCLUDE[csharp-build-only-diagnostic-note](~/includes/csharp-build-only-diagnostic-note.md)]
1618

1719
- The [**NoStandardLib**](../compiler-options/advanced.md#nostandardlib) option from the command line compiler has been specified. The **NoStandardLib** option prevents the import of mscorlib.dll. Use this option if you want to define or create a user-specific System namespace.
1820

docs/csharp/language-reference/compiler-messages/cs0570.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ ms.assetid: 6b378974-fdd9-451b-b595-6b5b19b4ab48
1212

1313
Property, indexer, or event 'name' is not supported by the language; try directly calling accessor method 'name!'
1414

15-
This error occurs when using imported metadata that was generated by another compiler. Your code attempted to use a class member that the compiler cannot process.
15+
This error occurs when using imported metadata that was generated by another compiler. Your code attempted to use a class member that the compiler cannot process.
16+
17+
[!INCLUDE[csharp-build-only-diagnostic-note](~/includes/csharp-build-only-diagnostic-note.md)]
1618

1719
## Example 1
1820

docs/csharp/language-reference/compiler-messages/cs1607.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ ms.assetid: 7ad8e1a4-40c2-41cc-b4ee-cc4d7beb4372
1313
Assembly generation -- reason
1414

1515
A warning was generated from the assembly-creation phase of the compilation.
16+
17+
[!INCLUDE[csharp-build-only-diagnostic-note](~/includes/csharp-build-only-diagnostic-note.md)]
1618

1719
If you are building a 64-bit application on a 32-bit operating system, you must ensure that 64-bit versions of all referenced assemblies are installed on the target operating system.
1820

docs/csharp/language-reference/compiler-messages/cs8178.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ helpviewer_keywords:
1111

1212
'await' cannot be used in an expression containing a call to because it returns by reference
1313

14+
[!INCLUDE[csharp-build-only-diagnostic-note](~/includes/csharp-build-only-diagnostic-note.md)]
15+
1416
## Example
1517

1618
The following sample generates CS8178:

docs/csharp/misc/cs0017.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ ms.assetid: 5e2a3eb3-6f6e-485d-8293-ceabea4d6905
1313
Program 'output file name' has more than one entry point defined. Compile with /main to specify the type that contains the entry point.
1414

1515
A program can only have one [Main](../fundamentals/program-structure/main-command-line.md) method.
16+
17+
[!INCLUDE[csharp-build-only-diagnostic-note](~/includes/csharp-build-only-diagnostic-note.md)]
1618

1719
To resolve this error, you can either delete all Main methods in your code, except one, or you can use the [**StartupObject**](../language-reference/compiler-options/advanced.md#mainentrypoint-or-startupobject) compiler option to specify which Main method you want to use.
1820

docs/csharp/misc/cs0028.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ ms.assetid: 47df919f-01fa-45ae-a4b7-912445e679e2
1313
'function declaration' has the wrong signature to be an entry point
1414

1515
The method declaration for `Main` was invalid: it was declared with an invalid signature. `Main` must be declared as static and it must return either [int](../language-reference/builtin-types/integral-numeric-types.md) or [void](../language-reference/builtin-types/void.md). For more information, see [Main() and Command-Line Arguments](../fundamentals/program-structure/main-command-line.md).
16+
17+
[!INCLUDE[csharp-build-only-diagnostic-note](~/includes/csharp-build-only-diagnostic-note.md)]
1618

1719
The following sample generates CS0028:
1820

docs/csharp/misc/cs0067.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ ms.assetid: df75220b-0b93-45ec-8655-98d9333b0bb7
1313
The event 'event' is never used
1414

1515
An [event](../language-reference/keywords/event.md) was declared but never used in the class in which it was declared.
16+
17+
[!INCLUDE[csharp-build-only-diagnostic-note](~/includes/csharp-build-only-diagnostic-note.md)]
1618

1719
The following sample generates CS0067:
1820

docs/csharp/misc/cs0148.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,6 @@ ms.assetid: d199afbf-02e1-4a1c-9e36-07bf86f1a2fb
1212

1313
The delegate 'delegate' does not have a valid constructor
1414

15-
You imported and used a managed program (one that uses the .NET runtime) that was created with another compiler. That compiler allowed an ill-formed [delegate](../language-reference/builtin-types/reference-types.md) constructor. For more information, see [Delegates](../programming-guide/delegates/index.md).
15+
You imported and used a managed program (one that uses the .NET runtime) that was created with another compiler. That compiler allowed an ill-formed [delegate](../language-reference/builtin-types/reference-types.md) constructor. For more information, see [Delegates](../programming-guide/delegates/index.md).
16+
17+
[!INCLUDE[csharp-build-only-diagnostic-note](~/includes/csharp-build-only-diagnostic-note.md)]

docs/csharp/misc/cs0169.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ ms.assetid: 04b0015f-658d-440a-b9ba-831178f1a180
1313
The private field 'class member' is never used
1414

1515
A private variable was declared but never referenced. A common way to generate this warning is when you declare a private member of a class and do not use it.
16+
17+
[!INCLUDE[csharp-build-only-diagnostic-note](~/includes/csharp-build-only-diagnostic-note.md)]
1618

1719
The following sample generates CS0169:
1820

docs/csharp/misc/cs0204.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,6 @@ ms.assetid: c1811479-41b3-4a0b-9160-ecc14bf255a3
1212

1313
Only 65534 locals are allowed
1414

15-
The limit of 65534 local variables has been exceeded in a method.
15+
The limit of 65534 local variables has been exceeded in a method.
16+
17+
[!INCLUDE[csharp-build-only-diagnostic-note](~/includes/csharp-build-only-diagnostic-note.md)]

0 commit comments

Comments
 (0)