Skip to content

Commit ffa8e8d

Browse files
Merge pull request #10425 from dotnet/main
Merge main into live
2 parents 14963c6 + d4d65ad commit ffa8e8d

File tree

8 files changed

+83
-28
lines changed

8 files changed

+83
-28
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<OutputType>Library</OutputType>
5+
<TargetFramework>net6.0</TargetFramework>
6+
</PropertyGroup>
7+
8+
</Project>

snippets/csharp/System.Security/SecureString/AppendChar/xat.cs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
using System;
33
using System.Security;
44

5-
class Example
5+
class SecureStringExample
66
{
77
public static void Main()
88
{
9-
string msg = "The curent length of the SecureString object: {0}\n";
9+
string msg = "The current length of the SecureString object: {0}\n";
1010
Console.WriteLine("1) Instantiate the SecureString object.");
1111
SecureString ss = new SecureString();
1212
Console.WriteLine(msg, ss.Length);
@@ -44,26 +44,26 @@ public static void Main()
4444
}
4545
// The example displays the following output:
4646
// 1) Instantiate the SecureString object.
47-
// The curent length of the SecureString object: 0
47+
// The current length of the SecureString object: 0
4848
//
4949
// 2) Append 'a' to the value.
50-
// The curent length of the SecureString object: 1
50+
// The current length of the SecureString object: 1
5151
//
5252
// 3) Append 'X' to the value.
53-
// The curent length of the SecureString object: 2
53+
// The current length of the SecureString object: 2
5454
//
5555
// 4) Append 'c' to the value.
56-
// The curent length of the SecureString object: 3
56+
// The current length of the SecureString object: 3
5757
//
5858
// 5) Insert 'd' at the end of the value.
59-
// The curent length of the SecureString object: 4
59+
// The current length of the SecureString object: 4
6060
//
6161
// 6) Remove the last character ('d') from the value.
62-
// The curent length of the SecureString object: 3
62+
// The current length of the SecureString object: 3
6363
//
6464
// 7) Set the second character of the value to 'b'.
65-
// The curent length of the SecureString object: 3
65+
// The current length of the SecureString object: 3
6666
//
6767
// 8) Delete the value of the SecureString object:
68-
// The curent length of the SecureString object: 0
69-
//</snippet1>
68+
// The current length of the SecureString object: 0
69+
//</snippet1>
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<OutputType>Exe</OutputType>
5+
<TargetFramework>net6.0</TargetFramework>
6+
</PropertyGroup>
7+
8+
</Project>

snippets/visualbasic/VS_Snippets_CLR/SecureString.xAt/VB/xat.vb

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Imports System.Security
33

44
Module Example
55
Public Sub Main()
6-
Dim msg As String = "The curent length of the SecureString object: {0}" + vbCrLf
6+
Dim msg As String = "The current length of the SecureString object: {0}" + vbCrLf
77
Console.WriteLine("1) Instantiate the SecureString object.")
88
Dim ss As New SecureString()
99
Console.WriteLine(msg, ss.Length)
@@ -41,26 +41,26 @@ Module Example
4141
End Module
4242
' The example displays the following output:
4343
' 1) Instantiate the SecureString object.
44-
' The curent length of the SecureString object: 0
44+
' The current length of the SecureString object: 0
4545
'
4646
' 2) Append 'a' to the value.
47-
' The curent length of the SecureString object: 1
47+
' The current length of the SecureString object: 1
4848
'
4949
' 3) Append 'X' to the value.
50-
' The curent length of the SecureString object: 2
50+
' The current length of the SecureString object: 2
5151
'
5252
' 4) Append 'c' to the value.
53-
' The curent length of the SecureString object: 3
53+
' The current length of the SecureString object: 3
5454
'
5555
' 5) Insert 'd' at the end of the value.
56-
' The curent length of the SecureString object: 4
56+
' The current length of the SecureString object: 4
5757
'
5858
' 6) Remove the last character ('d') from the value.
59-
' The curent length of the SecureString object: 3
59+
' The current length of the SecureString object: 3
6060
'
6161
' 7) Set the second character of the value to 'b'.
62-
' The curent length of the SecureString object: 3
62+
' The current length of the SecureString object: 3
6363
'
6464
' 8) Delete the value of the SecureString object:
65-
' The curent length of the SecureString object: 0
66-
'</snippet1>
65+
' The current length of the SecureString object: 0
66+
'</snippet1>

xml/System.Diagnostics/Debugger.xml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -218,9 +218,17 @@ Console.WriteLine("Hello, world.");
218218
<Parameter Name="exception" Type="System.Exception" Index="0" FrameworkAlternate="net-9.0" />
219219
</Parameters>
220220
<Docs>
221-
<param name="exception">To be added.</param>
222-
<summary>To be added.</summary>
223-
<remarks>To be added.</remarks>
221+
<param name="exception">The user-unhandled exception.</param>
222+
<summary>
223+
Signals a breakpoint to an attached debugger with the <paramref name="exception" /> details if a .NET debugger is attached with break on user-unhandled exception enabled and a method attributed with DebuggerDisableUserUnhandledExceptionsAttribute calls this method.
224+
</summary>
225+
<remarks>
226+
<format type="text/markdown"><![CDATA[
227+
228+
## Remarks
229+
This API is designed to be used with <xref:System.Diagnostics.DebuggerDisableUserUnhandledExceptionsAttribute>. If a .NET debugger is attached and the debugger supports breaking on user-unhandled exceptions, this method signals a breakpoint to the debugger with the `exception` parameter.
230+
]]></format>
231+
</remarks>
224232
</Docs>
225233
</Member>
226234
<Member MemberName="DefaultCategory">

xml/System.Diagnostics/DebuggerDisableUserUnhandledExceptionsAttribute.xml

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,39 @@
2020
</Attribute>
2121
</Attributes>
2222
<Docs>
23-
<summary>To be added.</summary>
24-
<remarks>To be added.</remarks>
23+
<summary>
24+
If a .NET Debugger is attached that supports the <see cref="M:System.Diagnostics.Debugger.BreakForUserUnhandledException(System.Exception)" /> API, the debugger won't break on user-unhandled exceptions when the exception is caught by a method with this attribute, unless <see cref="M:System.Diagnostics.Debugger.BreakForUserUnhandledException(System.Exception)" /> is called.
25+
</summary>
26+
<remarks>
27+
<format type="text/markdown"><![CDATA[
28+
29+
## Remarks
30+
Visual Studio has added support for catching asynchronous user-unhandled exceptions and it's enabled by default. This feature has existed for a long time for synchronous methods, but not for `async`/`await` methods. The <xref:System.Diagnostics.Debugger.BreakForUserUnhandledException(System.Exception)> method disables the feature for specific methods. This is useful for exceptions that propagate through user code but are expected to be handled by framework code. This attribute is designed to be used along with <xref:System.Diagnostics.Debugger.BreakForUserUnhandledException(System.Exception)>.
31+
32+
## Example
33+
34+
```csharp
35+
[MethodImpl(MethodImplOptions.NoInlining)]
36+
[DebuggerDisableUserUnhandledExceptions]
37+
static async Task InvokeUserCode(Func<Task> userCode)
38+
{
39+
try
40+
{
41+
await userCode();
42+
}
43+
catch (Exception ex)
44+
{
45+
if (TryHandleWithFilter(ex))
46+
{
47+
return; // example case where we don't want to break for user-unhandled exceptions
48+
}
49+
50+
Debugger.BreakForUserUnhandledException(e); // debugger will stop here and show the exception if attached.
51+
}
52+
}
53+
```
54+
]]></format>
55+
</remarks>
2556
</Docs>
2657
<Members>
2758
<Member MemberName=".ctor">

xml/System.Text.Json.Serialization/JsonPolymorphicAttribute.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@
9292
<ReturnType>System.String</ReturnType>
9393
</ReturnValue>
9494
<Docs>
95-
<summary>Gets or sets a custom type discriminator property name for the polymorhic type.
95+
<summary>Gets or sets a custom type discriminator property name for the polymorphic type.
9696
Uses the default '$type' property name if left unset.</summary>
9797
<value>To be added.</value>
9898
<remarks>To be added.</remarks>

xml/System/Range.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ int[] subArray2 = someArray[1..^0]; // { 2, 3, 4, 5 }
353353
354354
## Remarks
355355
356-
For performance reasons, this method does't validate `length` to ensure that it is not negative. It does ensure that `length` is within the current `Range` instance.
356+
For performance reasons, this method doesn't validate `length` to ensure that it is not negative. It does ensure that `length` is within the current `Range` instance.
357357
358358
]]></format>
359359
</remarks>

0 commit comments

Comments
 (0)