Skip to content

Commit c0f5679

Browse files
Merge pull request #11459 from dotnet/main
Merge main into live
2 parents a8d30ba + 5ecabb3 commit c0f5679

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

xml/System.Diagnostics.CodeAnalysis/FeatureSwitchDefinitionAttribute.xml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,15 @@
3131
corresponds to the feature switch specified by name.</para>
3232
</summary>
3333
<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+
<format type="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>
3743
</remarks>
3844
<example>
3945
<format type="text/markdown"><![CDATA[
@@ -55,10 +61,9 @@ When the app is trimmed with the following feature settings in the project file,
5561
5662
```xml
5763
<ItemGroup>
58-
<RuntimeHostConfigurationOption Include="Feature.IsSupported" Value="false" />
64+
<RuntimeHostConfigurationOption Include="Feature.IsSupported" Value="false" Trim="true" />
5965
</ItemGroup>
6066
```
61-
6267
]]></format>
6368
</example>
6469
</Docs>

xml/System.Diagnostics/ProcessStartInfo.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -645,7 +645,7 @@ If you use this property to set command-line arguments, <xref:System.Diagnostics
645645
</ReturnValue>
646646
<Docs>
647647
<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 <see langword="null" />.</value>
648+
<value>A generic dictionary containing the environment variables that apply to this process and its child processes.</value>
649649
<remarks>
650650
<format type="text/markdown"><![CDATA[
651651
@@ -728,7 +728,7 @@ If you use this property to set command-line arguments, <xref:System.Diagnostics
728728
</ReturnValue>
729729
<Docs>
730730
<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 <see langword="null" />.</value>
731+
<value>A string dictionary that provides environment variables that apply to this process and child processes.</value>
732732
<remarks>
733733
<format type="text/markdown"><![CDATA[
734734

0 commit comments

Comments
 (0)