Skip to content

Commit 9d97a4a

Browse files
Merge pull request #44122 from dotnet/main
Merge main into live
2 parents fc703a6 + f463647 commit 9d97a4a

File tree

6 files changed

+101
-141
lines changed

6 files changed

+101
-141
lines changed

Diff for: docs/core/compatibility/serialization/8.0/publishtrimmed.md

+4
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,7 @@ However, if you must use reflection, you can revert to the original behavior by
4949
## Affected APIs
5050

5151
N/A
52+
53+
## See also
54+
55+
- [Trimming options: Enable trimming](../../../deploying/trimming/trimming-options.md#enable-trimming)

Diff for: docs/core/install/linux-alpine.md

+1
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ When you install with a package manager, these libraries are installed for you.
7676
- libssl3
7777
- libstdc++
7878
- zlib
79+
- icu-libs and icu-data-full (unless the .NET app is running in [globalization-invariant mode](../runtime-config/globalization.md#invariant-mode)
7980
- libgdiplus (if the .NET app requires the *System.Drawing.Common* assembly)
8081

8182
Use the `apk add` command to install the dependencies.

Diff for: docs/core/tools/dotnet-install-script.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ ms.date: 12/26/2024
55
---
66
# dotnet-install scripts reference
77

8-
Note: The behavior of the install script has changed. It downloads .NET from new network locations. Please see [Critical: .NET Install links are changing](https://devblogs.microsoft.com/dotnet/critical-dotnet-install-links-are-changing/) for more information.
8+
> [!NOTE]
9+
> The behavior of the install script has changed. It downloads .NET from new network locations. For more information, see [Critical: .NET Install links are changing](https://devblogs.microsoft.com/dotnet/critical-dotnet-install-links-are-changing/).
910
1011
## Name
1112

Diff for: docs/csharp/language-reference/keywords/value.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ helpviewer_keywords:
99
---
1010
# The `value` implicit parameter
1111

12-
The implicit parameter `value` is used in the `set` accessor in [property](../../programming-guide/classes-and-structs/properties.md) and [indexer](../../programming-guide/indexers/index.md) declarations. It's an input parameter of a method. The word `value` references the value that client code is attempting to assign to the property or indexer. In the following example, `TimePeriod2` has a property called `Name` that uses the `value` parameter to assign a new string to the backing field `name`. From the point of view of client code, the operation is written as a simple assignment.
12+
The implicit parameter `value` is used in the `set` accessor in [property](../../programming-guide/classes-and-structs/properties.md) and [indexer](../../programming-guide/indexers/index.md) declarations. It's an input parameter of a method. The word `value` references the value that client code is attempting to assign to the property or indexer. In the following example, `TimePeriod2` has a property called `Seconds` that uses the `value` parameter to assign a new string to the backing field `_seconds`. From the point of view of client code, the operation is written as a simple assignment.
1313

1414
:::code language="csharp" source="./snippets/PropertyAccessors.cs" id="GetSetExpressions":::
1515

Diff for: docs/fundamentals/code-analysis/style-rules/ide0079.md

+16-8
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "IDE0079: Remove unnecessary suppression"
33
description: "Learn about code analysis rule IDE0079: Remove unnecessary suppression"
4-
ms.date: 03/23/2023
4+
ms.date: 12/27/2024
55
f1_keywords:
66
- IDE0079
77
- dotnet_remove_unnecessary_suppression_exclusions
@@ -71,15 +71,23 @@ class C2
7171

7272
Options specify the behavior that you want the rule to enforce. For information about configuring options, see [Option format](language-rules.md#option-format).
7373

74+
> [!NOTE]
75+
> Setting a severity in the format `option_name = value:severity` doesn't apply to the `dotnet_remove_unnecessary_suppression_exclusions` option and should be avoided. Instead, specify the severity using a separate entry, for example:
76+
>
77+
> ```ini
78+
> dotnet_remove_unnecessary_suppression_exclusions = none
79+
> dotnet_diagnostic.IDE0079.severity = warning
80+
> ```
81+
7482
### dotnet_remove_unnecessary_suppression_exclusions
7583
76-
| Property | Value | Description |
77-
| ------------------------ | ------------------------------------------------------------------------ | ---------------------------------------------- |
78-
| **Option name** | dotnet_remove_unnecessary_suppression_exclusions | |
79-
| **Option values** | `,` separated list of rule IDs or categories (prefixed with `category:`) | Excludes suppressions for the listed rules |
80-
| | `all` | Disables the rule (all rule IDs excluded) |
81-
| | `none` | Enables the rule for all rules (no exclusions) |
82-
| **Default option value** | `none` | |
84+
| Property | Value | Description |
85+
|--------------------------|--------------------------------------------------|------------------------------------------------|
86+
| **Option name** | dotnet_remove_unnecessary_suppression_exclusions | |
87+
| **Option values** | Comma-separated list of rule IDs or categories (prefixed with `category:`) | Excludes suppressions for the listed rules or categories |
88+
| | `all` | Disables the rule (all rule IDs excluded) |
89+
| | `none` | Enables the rule for all rules (no exclusions) |
90+
| **Default option value** | `none` | |
8391
8492
```csharp
8593
using System.Diagnostics.CodeAnalysis;

Diff for: docs/standard/linq/stream-xml-fragments-xmlreader.md

+77-131
Original file line numberDiff line numberDiff line change
@@ -27,163 +27,109 @@ The article [How to perform streaming transform of large XML documents](perform-
2727
This example creates a custom axis method. You can query it by using a LINQ query. The custom axis method `StreamRootChildDoc` can read a document that has a repeating `Child` element.
2828

2929
```csharp
30+
using System.Xml;
31+
using System.Xml.Linq;
32+
3033
static IEnumerable<XElement> StreamRootChildDoc(StringReader stringReader)
3134
{
32-
using (XmlReader reader = XmlReader.Create(stringReader))
35+
using XmlReader reader = XmlReader.Create(stringReader);
36+
37+
reader.MoveToContent();
38+
39+
// Parse the file and display each of the nodes.
40+
while (true)
3341
{
34-
reader.MoveToContent();
35-
// Parse the file and display each of the nodes.
36-
while (reader.Read())
42+
// If the current node is an element and named "Child"
43+
if (reader.NodeType == XmlNodeType.Element && reader.Name == "Child")
3744
{
38-
switch (reader.NodeType)
39-
{
40-
case XmlNodeType.Element:
41-
if (reader.Name == "Child") {
42-
XElement el = XElement.ReadFrom(reader) as XElement;
43-
if (el != null)
44-
yield return el;
45-
}
46-
break;
47-
}
45+
// Get the current node and advance the reader to the next
46+
if (XNode.ReadFrom(reader) is XElement el)
47+
yield return el;
48+
4849
}
50+
else if (!reader.Read())
51+
break;
4952
}
5053
}
5154

52-
static void Main(string[] args)
53-
{
54-
string markup = @"<Root>
55-
<Child Key=""01"">
56-
<GrandChild>aaa</GrandChild>
57-
</Child>
58-
<Child Key=""02"">
59-
<GrandChild>bbb</GrandChild>
60-
</Child>
61-
<Child Key=""03"">
62-
<GrandChild>ccc</GrandChild>
63-
</Child>
64-
</Root>";
65-
66-
IEnumerable<string> grandChildData =
67-
from el in StreamRootChildDoc(new StringReader(markup))
68-
where (int)el.Attribute("Key") > 1
69-
select (string)el.Element("GrandChild");
70-
71-
foreach (string str in grandChildData) {
72-
Console.WriteLine(str);
73-
}
74-
}
55+
string markup = """
56+
<Root>
57+
<Child Key="01">
58+
<GrandChild>aaa</GrandChild>
59+
</Child>
60+
<Child Key="02">
61+
<GrandChild>bbb</GrandChild>
62+
</Child>
63+
<Child Key="03">
64+
<GrandChild>ccc</GrandChild>
65+
</Child>
66+
</Root>
67+
""";
68+
69+
IEnumerable<string> grandChildData =
70+
from el in StreamRootChildDoc(new StringReader(markup))
71+
where (int)el.Attribute("Key") > 1
72+
select (string)el.Element("GrandChild");
73+
74+
foreach (string str in grandChildData)
75+
Console.WriteLine(str);
7576
```
7677

7778
```vb
78-
Module Module1
79-
Sub Main()
80-
Dim markup = "<Root>" &
81-
" <Child Key=""01"">" &
82-
" <GrandChild>aaa</GrandChild>" &
83-
" </Child>" &
84-
" <Child Key=""02"">" &
85-
" <GrandChild>bbb</GrandChild>" &
86-
" </Child>" &
87-
" <Child Key=""03"">" &
88-
" <GrandChild>ccc</GrandChild>" &
89-
" </Child>" &
90-
"</Root>"
91-
92-
Dim grandChildData =
93-
From el In New StreamRootChildDoc(New IO.StringReader(markup))
94-
Where CInt(el.@Key) > 1
95-
Select el.<GrandChild>.Value
96-
97-
For Each s In grandChildData
98-
Console.WriteLine(s)
99-
Next
100-
End Sub
101-
End Module
102-
103-
Public Class StreamRootChildDoc
104-
Implements IEnumerable(Of XElement)
79+
Imports System.Xml
10580

106-
Private _stringReader As IO.StringReader
107-
108-
Public Sub New(ByVal stringReader As IO.StringReader)
109-
_stringReader = stringReader
110-
End Sub
111-
112-
Public Function GetEnumerator() As IEnumerator(Of XElement) Implements IEnumerable(Of XElement).GetEnumerator
113-
Return New StreamChildEnumerator(_stringReader)
114-
End Function
81+
Module Module1
11582

116-
Public Function GetEnumerator1() As IEnumerator Implements IEnumerable.GetEnumerator
117-
Return Me.GetEnumerator()
118-
End Function
119-
End Class
83+
Public Iterator Function StreamRootChildDoc(stringReader As IO.StringReader) As IEnumerable(Of XElement)
84+
Using reader As XmlReader = XmlReader.Create(stringReader)
85+
reader.MoveToContent()
12086

121-
Public Class StreamChildEnumerator
122-
Implements IEnumerator(Of XElement)
87+
' Parse the file and display each of the nodes.
88+
While True
12389

124-
Private _current As XElement
125-
Private _reader As Xml.XmlReader
126-
Private _stringReader As IO.StringReader
90+
' If the current node is an element and named "Child"
91+
If reader.NodeType = XmlNodeType.Element And reader.Name = "Child" Then
12792

128-
Public Sub New(ByVal stringReader As IO.StringReader)
129-
_stringReader = stringReader
130-
_reader = Xml.XmlReader.Create(_stringReader)
131-
_reader.MoveToContent()
132-
End Sub
93+
' Get the current node and advance the reader to the next
94+
Dim el As XElement = TryCast(XNode.ReadFrom(reader), XElement)
13395

134-
Public ReadOnly Property Current As XElement Implements IEnumerator(Of XElement).Current
135-
Get
136-
Return _current
137-
End Get
138-
End Property
139-
140-
Public ReadOnly Property Current1 As Object Implements IEnumerator.Current
141-
Get
142-
Return Me.Current
143-
End Get
144-
End Property
145-
146-
Public Function MoveNext() As Boolean Implements IEnumerator.MoveNext
147-
While _reader.Read()
148-
Select Case _reader.NodeType
149-
Case Xml.XmlNodeType.Element
150-
Dim el = TryCast(XElement.ReadFrom(_reader), XElement)
151-
If el IsNot Nothing Then
152-
_current = el
153-
Return True
96+
If (el IsNot Nothing) Then
97+
Yield el
15498
End If
155-
End Select
156-
End While
15799

158-
Return False
100+
ElseIf Not reader.Read() Then
101+
Exit While
102+
End If
103+
104+
End While
105+
End Using
159106
End Function
160107

161-
Public Sub Reset() Implements IEnumerator.Reset
162-
_reader = Xml.XmlReader.Create(_stringReader)
163-
_reader.MoveToContent()
164-
End Sub
108+
Sub Main()
165109

166-
#Region "IDisposable Support"
110+
Dim markup = "<Root>
111+
<Child Key=""01"">
112+
<GrandChild>aaa</GrandChild>
113+
</Child>
114+
<Child Key=""02"">
115+
<GrandChild>bbb</GrandChild>
116+
</Child>
117+
<Child Key=""03"">
118+
<GrandChild>ccc</GrandChild>
119+
</Child>
120+
</Root>"
167121

168-
Private disposedValue As Boolean ' To detect redundant calls
122+
Dim grandChildData =
123+
From el In StreamRootChildDoc(New IO.StringReader(markup))
124+
Where CInt(el.@Key) > 1
125+
Select el.<GrandChild>.Value
169126

170-
' IDisposable
171-
Protected Overridable Sub Dispose(ByVal disposing As Boolean)
172-
If Not Me.disposedValue Then
173-
If disposing Then
174-
_reader.Close()
175-
End If
176-
End If
177-
Me.disposedValue = True
178-
End Sub
127+
For Each s In grandChildData
128+
Console.WriteLine(s)
129+
Next
179130

180-
Public Sub Dispose() Implements IDisposable.Dispose
181-
Dispose(True)
182-
GC.SuppressFinalize(Me)
183131
End Sub
184-
#End Region
185-
186-
End Class
132+
End Module
187133
```
188134

189135
This example produces the following output:

0 commit comments

Comments
 (0)