Skip to content

Commit 41fcab0

Browse files
CopilotBillWagner
andcommitted
Fix broken link warnings - update anchor references for compiler options
Co-authored-by: BillWagner <[email protected]>
1 parent f32e682 commit 41fcab0

File tree

13 files changed

+14
-14
lines changed

13 files changed

+14
-14
lines changed

docs/csharp/fundamentals/program-structure/main-command-line.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ helpviewer_keywords:
1616

1717
The `Main` method is the entry point of a C# application. When the application is started, the `Main` method is the first method that is invoked.
1818

19-
There can only be one entry point in a C# program. If you have more than one class that has a `Main` method, you must compile your program with the **StartupObject** compiler option to specify which `Main` method to use as the entry point. For more information, see [**StartupObject** (C# Compiler Options)](../../language-reference/compiler-options/advanced.md#mainentrypoint-or-startupobject). The following example displays the number of command line arguments as its first action:
19+
There can only be one entry point in a C# program. If you have more than one class that has a `Main` method, you must compile your program with the **StartupObject** compiler option to specify which `Main` method to use as the entry point. For more information, see [**StartupObject** (C# Compiler Options)](../../language-reference/compiler-options/advanced.md#startupobject). The following example displays the number of command line arguments as its first action:
2020

2121
:::code language="csharp" source="snippets/main-command-line/TestClass.cs":::
2222

docs/csharp/fundamentals/program-structure/top-level-statements.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ You can write a `Main` method explicitly, but it can't function as an entry poin
3838

3939
> CS7022 The entry point of the program is global code; ignoring 'Main()' entry point.
4040
41-
In a project with top-level statements, you can't use the [-main](../../language-reference/compiler-options/advanced.md#mainentrypoint-or-startupobject) compiler option to select the entry point, even if the project has one or more `Main` methods.
41+
In a project with top-level statements, you can't use the [-main](../../language-reference/compiler-options/advanced.md#startupobject) compiler option to select the entry point, even if the project has one or more `Main` methods.
4242

4343
## `using` directives
4444

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,15 +132,15 @@ The **library** option causes the compiler to create a dynamic-link library (DLL
132132

133133
### exe
134134

135-
The **exe** option causes the compiler to create an executable (EXE), console application. The executable file will be created with the .exe extension. Use **winexe** to create a Windows program executable. Unless otherwise specified with the [**OutputAssembly**](#outputassembly) option, the output file name takes the name of the input file that contains the entry point ([Main](../../fundamentals/program-structure/main-command-line.md) method or top-level statements). One and only one entry point is required in the source code files that are compiled into an .exe file. The [**StartupObject**](./advanced.md#mainentrypoint-or-startupobject) compiler option lets you specify which class contains the `Main` method, in cases where your code has more than one class with a `Main` method.
135+
The **exe** option causes the compiler to create an executable (EXE), console application. The executable file will be created with the .exe extension. Use **winexe** to create a Windows program executable. Unless otherwise specified with the [**OutputAssembly**](#outputassembly) option, the output file name takes the name of the input file that contains the entry point ([Main](../../fundamentals/program-structure/main-command-line.md) method or top-level statements). One and only one entry point is required in the source code files that are compiled into an .exe file. The [**StartupObject**](./advanced.md#startupobject) compiler option lets you specify which class contains the `Main` method, in cases where your code has more than one class with a `Main` method.
136136

137137
### module
138138

139139
This option causes the compiler to not generate an assembly manifest. By default, the output file created by compiling with this option will have an extension of *.netmodule*. A file that doesn't have an assembly manifest cannot be loaded by the .NET runtime. However, such a file can be incorporated into the assembly manifest of an assembly with [**AddModules**](inputs.md#addmodules). If more than one module is created in a single compilation, [internal](../keywords/internal.md) types in one module will be available to other modules in the compilation. When code in one module references `internal` types in another module, then both modules must be incorporated into an assembly manifest, with [**AddModules**](inputs.md#addmodules). Creating a module isn't supported in the Visual Studio development environment.
140140

141141
### winexe
142142

143-
The **winexe** option causes the compiler to create an executable (EXE), Windows program. The executable file will be created with the .exe extension. A Windows program is one that provides a user interface from either the .NET library or with the Windows APIs. Use **exe** to create a console application. Unless otherwise specified with the [**OutputAssembly**](#outputassembly) option, the output file name takes the name of the input file that contains the [`Main`](../../fundamentals/program-structure/main-command-line.md) method. One and only one `Main` method is required in the source code files that are compiled into an .exe file. The [**StartupObject**](./advanced.md#mainentrypoint-or-startupobject) option lets you specify which class contains the `Main` method, in cases where your code has more than one class with a `Main` method.
143+
The **winexe** option causes the compiler to create an executable (EXE), Windows program. The executable file will be created with the .exe extension. A Windows program is one that provides a user interface from either the .NET library or with the Windows APIs. Use **exe** to create a console application. Unless otherwise specified with the [**OutputAssembly**](#outputassembly) option, the output file name takes the name of the input file that contains the [`Main`](../../fundamentals/program-structure/main-command-line.md) method. One and only one `Main` method is required in the source code files that are compiled into an .exe file. The [**StartupObject**](./advanced.md#startupobject) option lets you specify which class contains the `Main` method, in cases where your code has more than one class with a `Main` method.
144144

145145
### winmdobj
146146

docs/csharp/misc/cs0017.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Program 'output file name' has more than one entry point defined. Compile with /
1616

1717
[!INCLUDE[csharp-build-only-diagnostic-note](~/includes/csharp-build-only-diagnostic-note.md)]
1818

19-
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.
19+
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#startupobject) compiler option to specify which Main method you want to use.
2020

2121
The following sample generates CS0017:
2222

docs/csharp/misc/cs1507.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ ms.assetid: e1be3aba-81dc-4f65-87a4-d3f90b82dc7d
1212

1313
Cannot link resource file 'file' when building a module
1414

15-
[**LinkResources**](../language-reference/compiler-options/resources.md#linkresources) was used in the same compilation with the **module** option on the [**TargetType**](../language-reference/compiler-options/output.md#targettype), which is not allowed. For example, the following options would generate CS1507:
15+
[**LinkResources**](../language-reference/compiler-options/resources.md#linkresources) was used in the same compilation with the **module** option on the [**OutputType**](../language-reference/compiler-options/output.md#outputtype), which is not allowed. For example, the following options would generate CS1507:
1616

1717
```console
1818
csc /linkresource:rf.resource /target:module in.cs

docs/csharp/misc/cs1509.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ ms.assetid: 51a475c3-f085-49cb-89b0-c6582b68653f
1212

1313
Referenced file 'file' is not an assembly; use **AddModules** option instead
1414

15-
An output file (output file 1), produced in a compilation that used the **module** element of the [**TargetType**](../language-reference/compiler-options/output.md#targettype) (does not have an assembly manifest), was specified to [**References**](../language-reference/compiler-options/inputs.md#references). So, rather than appending an assembly to the assembly for the current program, the metadata information in output file 1 will be added to the assembly for the current program.
15+
An output file (output file 1), produced in a compilation that used the **module** element of the [**OutputType**](../language-reference/compiler-options/output.md#outputtype) (does not have an assembly manifest), was specified to [**References**](../language-reference/compiler-options/inputs.md#references). So, rather than appending an assembly to the assembly for the current program, the metadata information in output file 1 will be added to the assembly for the current program.

docs/csharp/misc/cs1559.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ ms.assetid: 08e6c183-4e92-44a5-99f1-4d1eef3d0a67
1212

1313
Cannot use 'object' for Main method because it is imported
1414

15-
An invalid class was specified to the [**StartupObject**](../language-reference/compiler-options/advanced.md#mainentrypoint-or-startupobject) compiler option; the class cannot be used as a location for the [Main](../fundamentals/program-structure/main-command-line.md) method.
15+
An invalid class was specified to the [**StartupObject**](../language-reference/compiler-options/advanced.md#startupobject) compiler option; the class cannot be used as a location for the [Main](../fundamentals/program-structure/main-command-line.md) method.

docs/csharp/misc/cs1927.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,4 @@ class ManifestWithModule
4141
## See also
4242

4343
- [**Win32Manifest** (C# Compiler Options)](../language-reference/compiler-options/resources.md#win32manifest)
44-
- [**TargetType** module (C# Compiler Options)](../language-reference/compiler-options/output.md#targettype)
44+
- [**OutputType** module (C# Compiler Options)](../language-reference/compiler-options/output.md#outputtype)

docs/csharp/misc/cs2017.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ ms.assetid: 16fd0c3b-018f-4734-809d-8d98d05a254c
1212

1313
Cannot specify /main if building a module or library
1414

15-
You cannot specify a main entry point when you are building a **library** [**TargetType**](../language-reference/compiler-options/output.md#targettype).
15+
You cannot specify a main entry point when you are building a **library** [**OutputType**](../language-reference/compiler-options/output.md#outputtype).
1616

1717
The following sample generates CS2017:
1818

docs/csharp/misc/cs2022.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ ms.assetid: d22de497-c4ef-466f-8fbc-6faba7ba5ad0
1212

1313
Options '/out' and '/target' must appear before source file names
1414

15-
The [**-out** (Set Output Filename)](../language-reference/compiler-options/output.md#outputassembly) and [-target (Specify Output File Format)](../language-reference/compiler-options/output.md#targettype) compiler options, when specified on the command line, must precede the source code files.
15+
The [**-out** (Set Output Filename)](../language-reference/compiler-options/output.md#outputassembly) and [-target (Specify Output File Format)](../language-reference/compiler-options/output.md#outputtype) compiler options, when specified on the command line, must precede the source code files.

0 commit comments

Comments
 (0)