/subsystemversion (C# Compiler Options)
Specifies the minimum version of the subsystem on which the generated executable file can run, thereby determining the versions of Windows on which the executable file can run. Most commonly, this option ensures that the executable file can leverage particular security features that aren’t available with older versions of Windows.
Note
|
|---|
|
To specify the subsystem itself, use the /target compiler option. |
/subsystemversion:major.minor
The following table lists common subsystem versions of Windows.
|
Windows version |
Subsystem version |
|---|---|
|
Windows 2000 |
5.00 |
|
Windows XP |
5.01 |
|
Windows Server 2003 |
5.02 |
|
Windows Vista |
6.00 |
|
Windows 7 |
6.01 |
|
Windows Server 2008 |
6.01 |
|
Windows 8 |
6.02 |
Default values
The default value of the /subsystemversion compiler option depends on the conditions in the following list:
-
The default value is 6.02 if any compiler option in the following list is set:
-
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.
-
The default value is 4.00 if none of the previous conditions is true.
Setting this option
To set the /subsystemversion compiler option in Visual Studio, you must open the .csproj file and specify a value for the SubsystemVersion property in the MSBuild XML. You can't set this option in the Visual Studio IDE. For more information, see "Default values" earlier in this topic or Common MSBuild Project Properties.
Note