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
Copy file name to clipboardExpand all lines: docs/csharp/language-reference/compiler-options/advanced.md
+9-5Lines changed: 9 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
---
2
2
description: "Advanced C# Compiler Options. These options are used in advanced scenarios."
3
3
title: "Compiler Options - advanced scenarios"
4
-
ms.date: 03/12/2021
4
+
ms.date: 12/18/2024
5
5
f1_keywords:
6
6
- "cs.build.options"
7
7
helpviewer_keywords:
@@ -40,7 +40,7 @@ The following options support advanced scenarios. The new MSBuild syntax is show
40
40
-**Utf8Output** / `-utf8output`: Output compiler messages in UTF-8 encoding.
41
41
-**FileAlignment** / `-filealign`: Specify the alignment used for output file sections.
42
42
-**ErrorEndLocation** / `-errorendlocation`: Output line and column of the end location of each error.
43
-
-**NoStandardLib** / `-nostdlib`: Don't reference standard library*mscorlib.dll*.
43
+
-**NoStandardLib** / `-nostdlib`: Don't reference standard library. (Prevents automatic reference to the .NET Base Class Library - *mscorlib.dll* in .NET Framework projects, *System.Private.CoreLib.dll* in modern .NET projects.)
44
44
-**SubsystemVersion** / `-subsystemversion`: Specify subsystem version of this assembly.
45
45
-**ModuleAssemblyName** / `-moduleassemblyname`: Name of the assembly that this module will be a part of.
46
46
-**ReportIVTs** / `-reportivts`: Produce additional information on <xref:System.Runtime.CompilerServices.InternalsVisibleToAttribute?displayProperty=nameWithType> information.
@@ -226,13 +226,13 @@ By default, the compiler writes the starting location in source for all errors a
226
226
227
227
## NoStandardLib
228
228
229
-
**NoStandardLib** prevents the import of mscorlib.dll, which defines the entire System namespace.
229
+
**NoStandardLib** prevents the automatic reference to the .NET Base Class Library. In .NET Framework projects, this refers to *mscorlib.dll*, while in modern .NET projects (.NET 5+), this refers to *System.Private.CoreLib.dll*. Both assemblies define the entire System namespace.
230
230
231
231
```xml
232
232
<NoStandardLib>true</NoStandardLib>
233
233
```
234
234
235
-
Use this option if you want to define or create your own System namespace and objects. If you don't specify **NoStandardLib**, mscorlib.dll is imported into your program (same as specifying `<NoStandardLib>false</NoStandardLib>`).
235
+
Use this option if you want to define or create your own System namespace and objects. If you don't specify **NoStandardLib**, the appropriate base class library is automatically referenced (same as specifying `<NoStandardLib>false</NoStandardLib>`).
236
236
237
237
## SubsystemVersion
238
238
@@ -256,14 +256,18 @@ The following table lists common subsystem versions of Windows.
256
256
|Windows 7|6.01|
257
257
|Windows Server 2008|6.01|
258
258
|Windows 8|6.02|
259
+
|Windows 8.1|6.03|
260
+
|Windows 10|6.04|
261
+
|Windows 11|6.04|
259
262
260
263
The default value of the **SubsystemVersion** compiler option depends on the conditions in the following list:
261
264
262
265
- The default value is 6.02 if any compiler option in the following list is set:
263
266
-[-target:appcontainerexe](output.md#outputtype)
264
267
-[-target:winmdobj](output.md#outputtype)
265
268
-[-platform:arm](output.md#platformtarget)
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.
269
+
- The default value is 6.00 if you're using MSBuild, you're targeting .NET Framework 4.5 or later, and you haven't set any of the compiler options that were specified earlier in this list.
270
+
- For modern .NET projects (.NET 5+), the default value is 6.00, which allows your application to run on Windows Vista and later versions.
267
271
- The default value is 4.00 if none of the previous conditions are true.
0 commit comments