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: xml/System.Diagnostics.CodeAnalysis/FeatureSwitchDefinitionAttribute.xml
+10-5Lines changed: 10 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -31,9 +31,15 @@
31
31
corresponds to the feature switch specified by name.</para>
32
32
</summary>
33
33
<remarks>
34
-
<para>
35
-
IL rewriters and compilers can use this attribute to substitute the return value
36
-
of the specified property with the value of the feature switch.</para>
34
+
<formattype="text/markdown"><![CDATA[
35
+
IL rewriters and compilers can use this attribute to substitute the return value of the specified property with the value of the feature switch.
36
+
37
+
The value of the feature switch can only be specified at the application level and affects the entire application. It is possible to get into situations where one library that is part of the application requires the feature switch to be turned on, but has no way to communicate this to the application author.
38
+
39
+
Feature switches complicate unit testing and code sharing since different application configurations might have different values of the feature switch, and it's difficult to ensure all code paths work as expected.
40
+
41
+
It is therefore preferable to structure APIs in a way that trimming can happen naturally without any feature switches. The use of feature switches should be reserved for situations where trimming needs to happen, but it's not feasible to change the APIs to allow trimming naturally.
42
+
]]></format>
37
43
</remarks>
38
44
<example>
39
45
<formattype="text/markdown"><![CDATA[
@@ -55,10 +61,9 @@ When the app is trimmed with the following feature settings in the project file,
Copy file name to clipboardExpand all lines: xml/System.Diagnostics/ProcessStartInfo.xml
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -645,7 +645,7 @@ If you use this property to set command-line arguments, <xref:System.Diagnostics
645
645
</ReturnValue>
646
646
<Docs>
647
647
<summary>Gets the environment variables that apply to this process and its child processes.</summary>
648
-
<value>A generic dictionary containing the environment variables that apply to this process and its child processes. The default is <seelangword="null" />.</value>
648
+
<value>A generic dictionary containing the environment variables that apply to this process and its child processes.</value>
649
649
<remarks>
650
650
<formattype="text/markdown"><![CDATA[
651
651
@@ -728,7 +728,7 @@ If you use this property to set command-line arguments, <xref:System.Diagnostics
728
728
</ReturnValue>
729
729
<Docs>
730
730
<summary>Gets search paths for files, directories for temporary files, application-specific options, and other similar information.</summary>
731
-
<value>A string dictionary that provides environment variables that apply to this process and child processes. The default is <seelangword="null" />.</value>
731
+
<value>A string dictionary that provides environment variables that apply to this process and child processes.</value>
0 commit comments