You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Where `Program` is the type that contains the `Main` method. The provided class name must be fully qualified; it must include the full namespace containing the class, followed by the class name. For example, when the `Main` method is located inside the `Program` class in the `MyApplication.Core` namespace, the compiler option has to be `-main:MyApplication.Core.Program`. If your compilation includes more than one type with a [`Main`](../../fundamentals/program-structure/main-command-line.md) method, you can specify which type contains the `Main` method.
65
+
Where `Program` is the type that contains the `Main` method. The class name can be either fully qualified (including the namespace) or just the class name if it's unambiguous. For example, when the `Main` method is located inside the `Program` class in the `MyApplication.Core` namespace, you can specify either `-main:MyApplication.Core.Program` or just `-main:Program` if there's no ambiguity. If your compilation includes more than one type with a [`Main`](../../fundamentals/program-structure/main-command-line.md) method, you can specify which type contains the `Main` method.
72
66
73
67
> [!NOTE]
74
68
> This option can't be used for a project that includes [top-level statements](../../fundamentals/program-structure/top-level-statements.md), even if that project contains one or more `Main` methods.
@@ -245,7 +239,7 @@ Use this option if you want to define or create your own System namespace and ob
245
239
Specifies the minimum version of the subsystem on which the executable file runs. Most commonly, this option ensures that the executable file can use security features that aren’t available with older versions of Windows.
246
240
247
241
> [!NOTE]
248
-
> To specify the subsystem itself, use the [**TargetType**](./output.md#targettype) compiler option.
242
+
> To specify the subsystem itself, use the [**OutputType**](./output.md#outputtype) compiler option.
249
243
250
244
```xml
251
245
<SubsystemVersion>major.minor</SubsystemVersion>
@@ -266,9 +260,9 @@ The following table lists common subsystem versions of Windows.
266
260
The default value of the **SubsystemVersion** compiler option depends on the conditions in the following list:
267
261
268
262
- The default value is 6.02 if any compiler option in the following list is set:
269
-
-[-target:appcontainerexe](output.md)
270
-
-[-target:winmdobj](output.md)
271
-
-[-platform:arm](output.md)
263
+
-[-target:appcontainerexe](output.md#outputtype)
264
+
-[-target:winmdobj](output.md#outputtype)
265
+
-[-platform:arm](output.md#platformtarget)
272
266
- The default value is 6.00 if you're using MSBuild, you're targeting .NET Framework 4.5, and you haven't set any of the compiler options that were specified earlier in this list.
273
267
- The default value is 4.00 if none of the previous conditions are true.
274
268
@@ -286,7 +280,7 @@ Specifies the name of an assembly whose nonpublic types a *.netmodule* can acces
286
280
- You know the name of the assembly into which the .netmodule will be built.
287
281
- The existing assembly has granted friend assembly access to the assembly into which the .*netmodule* will be built.
288
282
289
-
For more information on building a .netmodule, see [**TargetType**](output.md#targettype) option of **module**. For more information on friend assemblies, see [Friend Assemblies](../../../standard/assembly/friend.md).
283
+
For more information on building a .netmodule, see [**OutputType**](output.md#outputtype) option of **module**. For more information on friend assemblies, see [Friend Assemblies](../../../standard/assembly/friend.md).
The source code file that contains Main or top-level statements is output first into the XML. You'll often want to use the generated .xml file with [IntelliSense](/visualstudio/ide/using-intellisense). The *.xml* filename must be the same as the assembly name. The *.xml* file must be in the same directory as the assembly. When the assembly is referenced in a Visual Studio project, the *.xml* file is found as well. For more information about generating code comments, see [Supplying Code Comments](/visualstudio/ide/reference/generate-xml-documentation-comments). Unless you compile with [`<TargetType:Module>`](#targettype), `file` will contain `<assembly>` and `</assembly>` tags specifying the name of the file containing the assembly manifest for the output file. For examples, see [How to use the XML documentation features](../xmldoc/index.md).
37
+
The source code file that contains Main or top-level statements is output first into the XML. You'll often want to use the generated .xml file with [IntelliSense](/visualstudio/ide/using-intellisense). The *.xml* filename must be the same as the assembly name. The *.xml* file must be in the same directory as the assembly. When the assembly is referenced in a Visual Studio project, the *.xml* file is found as well. For more information about generating code comments, see [Supplying Code Comments](/visualstudio/ide/reference/generate-xml-documentation-comments). Unless you compile with [`<OutputType:module>`](#outputtype), `file` will contain `<assembly>` and `</assembly>` tags specifying the name of the file containing the assembly manifest for the output file. For examples, see [How to use the XML documentation features](../xmldoc/index.md).
38
38
39
39
> [!NOTE]
40
40
> The **DocumentationFile** option applies to all files in the project. To disable warnings related to documentation comments for a specific file or section of code, use [#pragma warning](../preprocessor-directives.md#pragma-warning).
@@ -43,13 +43,14 @@ This option can be used in any .NET SDK-style project. For more information, see
43
43
44
44
## OutputAssembly
45
45
46
-
The **OutputAssembly** option specifies the name of the output file. The output path specifies the folder where compiler output is placed.
46
+
The **OutputAssembly** option specifies the name of the output file. This option corresponds to the combination of the `OutputPath` and `AssemblyName` MSBuild properties that control where the compiled assembly is placed and what it's named.
47
47
48
48
```xml
49
-
<OutputAssembly>folder</OutputAssembly>
49
+
<OutputPath>bin\Debug\</OutputPath>
50
+
<AssemblyName>MyApplication</AssemblyName>
50
51
```
51
52
52
-
Specify the full name and extension of the file you want to create. If you don't specify the name of the output file, MSBuild uses the name of the project to specify the name of the output assembly. Old style projects use the following rules:
53
+
Specify the name and extension of the file you want to create. The path can be relative or absolute. If you don't specify the name of the output file, MSBuild uses the project name to specify the name of the output assembly. Old style projects use the following rules:
53
54
54
55
- An .exe will take its name from the source code file that contains the `Main` method or top-level statements.
55
56
- A .dll or .netmodule will take its name from the first source code file.
@@ -103,9 +104,9 @@ You generally don't need to work directly with reference assembly files. By defa
103
104
104
105
.NET SDK 6.0.200 made a [change](../../../core/compatibility/sdk/6.0/write-reference-assemblies-to-obj.md) that moved reference assemblies from the output directory to the intermediate directory by default.
105
106
106
-
## TargetType
107
+
## OutputType
107
108
108
-
The **TargetType** compiler option can be specified in one of the following forms:
109
+
The **OutputType** compiler option can be specified in one of the following forms:
109
110
110
111
-**library**: to create a code library. **library** is the default value.
111
112
-**exe**: to create an .exe file.
@@ -118,7 +119,7 @@ The **TargetType** compiler option can be specified in one of the following form
118
119
> For .NET Framework targets, unless you specify **module**, this option causes a .NET Framework assembly manifest to be placed in an output file. For more information, see [Assemblies in .NET](../../../standard/assembly/index.md) and [Common Attributes](../attributes/global.md).
119
120
120
121
```xml
121
-
<TargetType>library</TargetType>
122
+
<OutputType>library</OutputType>
122
123
```
123
124
124
125
The compiler creates only one assembly manifest per compilation. Information about all files in a compilation is placed in the assembly manifest. When producing multiple output files at the command line, only one assembly manifest can be created and it must go into the first output file specified on the command line.
Copy file name to clipboardExpand all lines: docs/csharp/misc/cs0734.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,7 +14,7 @@ The /moduleassemblyname option may only be specified when building a target type
14
14
15
15
The compiler option **ModuleAssemblyName** should only be used when building a .netmodule. See [**ModuleAssemblyName** (C# Compiler Option)](../language-reference/compiler-options/advanced.md#moduleassemblyname) for more information.
16
16
17
-
For more information on building a .netmodule, see the **module** element for the [**TargetType** (C# Compiler Options)](../language-reference/compiler-options/output.md#targettype).
17
+
For more information on building a .netmodule, see the **module** element for the [**OutputType** (C# Compiler Options)](../language-reference/compiler-options/output.md#outputtype).
'dll' cannot be added to this assembly because it already is an assembly; use '/R' option instead
14
14
15
-
The file that was referenced with the [**AddModules**](../language-reference/compiler-options/inputs.md#addmodules) compiler option was not built with **module** element of the [**TargetType** compiler option](../language-reference/compiler-options/output.md#targettype); use [**References**](../language-reference/compiler-options/inputs.md#references) to reference the file in this compilation.
15
+
The file that was referenced with the [**AddModules**](../language-reference/compiler-options/inputs.md#addmodules) compiler option was not built with **module** element of the [**OutputType** compiler option](../language-reference/compiler-options/output.md#outputtype); use [**References**](../language-reference/compiler-options/inputs.md#references) to reference the file in this compilation.
A class was specified to the [**MainEntryPoint**](../language-reference/compiler-options/advanced.md#mainentrypoint-or-startupobject) compiler option, but the class name was not found in the source code.
15
+
A class was specified to the [**StartupObject**](../language-reference/compiler-options/advanced.md#startupobject) compiler option, but the class name was not found in the source code.
'construct' specified for Main method must be a valid class or struct
14
14
15
-
The [**MainEntryPoint**](../language-reference/compiler-options/advanced.md#mainentrypoint-or-startupobject) compiler option was passed an identifier that was not a class name.
15
+
The [**StartupObject**](../language-reference/compiler-options/advanced.md#startupobject) compiler option was passed an identifier that was not a class name.
Cannot use 'class' for Main method because it is in a different output file
14
14
15
-
The [**MainEntryPoint**](../language-reference/compiler-options/advanced.md#mainentrypoint-or-startupobject) compiler option was specified for one output file in a multi-output file compilation. However, the class was not found in the source code for the /main compilation; it was found in a source code file for one of the other output files in the compilation.
15
+
The [**StartupObject**](../language-reference/compiler-options/advanced.md#startupobject) compiler option was specified for one output file in a multi-output file compilation. However, the class was not found in the source code for the /main compilation; it was found in a source code file for one of the other output files in the compilation.
'class' does not have a suitable static Main method
14
14
15
-
The [**MainEntryPoint**](../language-reference/compiler-options/advanced.md#mainentrypoint-or-startupobject) compiler option specified a class in which to look for a **Main** method. However, the [Main](../fundamentals/program-structure/main-command-line.md) method was not defined correctly.
15
+
The [**StartupObject**](../language-reference/compiler-options/advanced.md#startupobject) compiler option specified a class in which to look for a **Main** method. However, the [Main](../fundamentals/program-structure/main-command-line.md) method was not defined correctly.
Invalid target type for /target: must specify 'exe', 'winexe', 'library', or 'module'
14
14
15
-
The [**TargetType**](../language-reference/compiler-options/output.md#targettype) compiler option was used, but an invalid parameter was passed. To resolve this error, recompile the program using the form of the **/target** option that is appropriate to your output file.
15
+
The [**OutputType**](../language-reference/compiler-options/output.md#outputtype) compiler option was used, but an invalid parameter was passed. To resolve this error, recompile the program using the form of the **/target** option that is appropriate to your output file.
Copy file name to clipboardExpand all lines: docs/framework/tools/winmdexp-exe-windows-runtime-metadata-export-tool.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -27,7 +27,7 @@ winmdexp [options] winmdmodule
27
27
28
28
|Argument or option|Description|
29
29
|------------------------|-----------------|
30
-
|`winmdmodule`|Specifies the module (.winmdobj) to be exported. Only one module is allowed. To create this module, use the `/target` compiler option with the `winmdobj` target. See [-target:winmdobj (C# Compiler Options)](../../csharp/language-reference/compiler-options/output.md#targettype) or [-target (Visual Basic)](../../visual-basic/reference/command-line-compiler/target.md).|
30
+
|`winmdmodule`|Specifies the module (.winmdobj) to be exported. Only one module is allowed. To create this module, use the `/target` compiler option with the `winmdobj` target. See [-target:winmdobj (C# Compiler Options)](../../csharp/language-reference/compiler-options/output.md#outputtype) or [-target (Visual Basic)](../../visual-basic/reference/command-line-compiler/target.md).|
31
31
|`/docfile:``docfile`<br /><br /> `/d:``docfile`|Specifies the output XML documentation file that Winmdexp.exe will produce. In .NET Framework 4.5, the output file is essentially the same as the input XML documentation file.|
32
32
|`/moduledoc:``docfile`<br /><br /> `/md:``docfile`|Specifies the name of the XML documentation file that the compiler produced with `winmdmodule`.|
33
33
|`/modulepdb:``symbolfile`<br /><br /> `/mp:``symbolfile`|Specifies the name of the program database (PDB) file that contains symbols for `winmdmodule`.|
0 commit comments