diff --git a/snippets/csharp/System.Security/SecureString/AppendChar/Project.csproj b/snippets/csharp/System.Security/SecureString/AppendChar/Project.csproj new file mode 100644 index 00000000000..0735dba1f6d --- /dev/null +++ b/snippets/csharp/System.Security/SecureString/AppendChar/Project.csproj @@ -0,0 +1,8 @@ + + + + Library + net6.0 + + + diff --git a/snippets/csharp/System.Security/SecureString/AppendChar/xat.cs b/snippets/csharp/System.Security/SecureString/AppendChar/xat.cs index 102cd2f3361..2c368cbbde3 100644 --- a/snippets/csharp/System.Security/SecureString/AppendChar/xat.cs +++ b/snippets/csharp/System.Security/SecureString/AppendChar/xat.cs @@ -2,11 +2,11 @@ using System; using System.Security; -class Example +class SecureStringExample { public static void Main() { - string msg = "The curent length of the SecureString object: {0}\n"; + string msg = "The current length of the SecureString object: {0}\n"; Console.WriteLine("1) Instantiate the SecureString object."); SecureString ss = new SecureString(); Console.WriteLine(msg, ss.Length); @@ -44,26 +44,26 @@ public static void Main() } // The example displays the following output: // 1) Instantiate the SecureString object. -// The curent length of the SecureString object: 0 +// The current length of the SecureString object: 0 // // 2) Append 'a' to the value. -// The curent length of the SecureString object: 1 +// The current length of the SecureString object: 1 // // 3) Append 'X' to the value. -// The curent length of the SecureString object: 2 +// The current length of the SecureString object: 2 // // 4) Append 'c' to the value. -// The curent length of the SecureString object: 3 +// The current length of the SecureString object: 3 // // 5) Insert 'd' at the end of the value. -// The curent length of the SecureString object: 4 +// The current length of the SecureString object: 4 // // 6) Remove the last character ('d') from the value. -// The curent length of the SecureString object: 3 +// The current length of the SecureString object: 3 // // 7) Set the second character of the value to 'b'. -// The curent length of the SecureString object: 3 +// The current length of the SecureString object: 3 // // 8) Delete the value of the SecureString object: -// The curent length of the SecureString object: 0 -// \ No newline at end of file +// The current length of the SecureString object: 0 +// diff --git a/snippets/visualbasic/VS_Snippets_CLR/SecureString.xAt/VB/Project.vbproj b/snippets/visualbasic/VS_Snippets_CLR/SecureString.xAt/VB/Project.vbproj new file mode 100644 index 00000000000..41f1d5ad4b2 --- /dev/null +++ b/snippets/visualbasic/VS_Snippets_CLR/SecureString.xAt/VB/Project.vbproj @@ -0,0 +1,8 @@ + + + + Exe + net6.0 + + + diff --git a/snippets/visualbasic/VS_Snippets_CLR/SecureString.xAt/VB/xat.vb b/snippets/visualbasic/VS_Snippets_CLR/SecureString.xAt/VB/xat.vb index eef60d0443e..e113b806c74 100644 --- a/snippets/visualbasic/VS_Snippets_CLR/SecureString.xAt/VB/xat.vb +++ b/snippets/visualbasic/VS_Snippets_CLR/SecureString.xAt/VB/xat.vb @@ -3,7 +3,7 @@ Imports System.Security Module Example Public Sub Main() - Dim msg As String = "The curent length of the SecureString object: {0}" + vbCrLf + Dim msg As String = "The current length of the SecureString object: {0}" + vbCrLf Console.WriteLine("1) Instantiate the SecureString object.") Dim ss As New SecureString() Console.WriteLine(msg, ss.Length) @@ -41,26 +41,26 @@ Module Example End Module ' The example displays the following output: ' 1) Instantiate the SecureString object. -' The curent length of the SecureString object: 0 +' The current length of the SecureString object: 0 ' ' 2) Append 'a' to the value. -' The curent length of the SecureString object: 1 +' The current length of the SecureString object: 1 ' ' 3) Append 'X' to the value. -' The curent length of the SecureString object: 2 +' The current length of the SecureString object: 2 ' ' 4) Append 'c' to the value. -' The curent length of the SecureString object: 3 +' The current length of the SecureString object: 3 ' ' 5) Insert 'd' at the end of the value. -' The curent length of the SecureString object: 4 +' The current length of the SecureString object: 4 ' ' 6) Remove the last character ('d') from the value. -' The curent length of the SecureString object: 3 +' The current length of the SecureString object: 3 ' ' 7) Set the second character of the value to 'b'. -' The curent length of the SecureString object: 3 +' The current length of the SecureString object: 3 ' ' 8) Delete the value of the SecureString object: -' The curent length of the SecureString object: 0 -' \ No newline at end of file +' The current length of the SecureString object: 0 +' diff --git a/xml/System.Diagnostics/Debugger.xml b/xml/System.Diagnostics/Debugger.xml index e4310db60a1..bb3496c5b8b 100644 --- a/xml/System.Diagnostics/Debugger.xml +++ b/xml/System.Diagnostics/Debugger.xml @@ -218,9 +218,17 @@ Console.WriteLine("Hello, world."); - To be added. - To be added. - To be added. + The user-unhandled exception. + + Signals a breakpoint to an attached debugger with the details if a .NET debugger is attached with break on user-unhandled exception enabled and a method attributed with DebuggerDisableUserUnhandledExceptionsAttribute calls this method. + + + . 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. + ]]> + diff --git a/xml/System.Diagnostics/DebuggerDisableUserUnhandledExceptionsAttribute.xml b/xml/System.Diagnostics/DebuggerDisableUserUnhandledExceptionsAttribute.xml index 52574402d17..5f321f84b1d 100644 --- a/xml/System.Diagnostics/DebuggerDisableUserUnhandledExceptionsAttribute.xml +++ b/xml/System.Diagnostics/DebuggerDisableUserUnhandledExceptionsAttribute.xml @@ -20,8 +20,39 @@ - To be added. - To be added. + + If a .NET Debugger is attached that supports the API, the debugger won't break on user-unhandled exceptions when the exception is caught by a method with this attribute, unless is called. + + + 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 . + + ## Example + + ```csharp + [MethodImpl(MethodImplOptions.NoInlining)] + [DebuggerDisableUserUnhandledExceptions] + static async Task InvokeUserCode(Func userCode) + { + try + { + await userCode(); + } + catch (Exception ex) + { + if (TryHandleWithFilter(ex)) + { + return; // example case where we don't want to break for user-unhandled exceptions + } + + Debugger.BreakForUserUnhandledException(e); // debugger will stop here and show the exception if attached. + } + } + ``` + ]]> + diff --git a/xml/System.Text.Json.Serialization/JsonPolymorphicAttribute.xml b/xml/System.Text.Json.Serialization/JsonPolymorphicAttribute.xml index ad53faa1f26..127d11293b2 100644 --- a/xml/System.Text.Json.Serialization/JsonPolymorphicAttribute.xml +++ b/xml/System.Text.Json.Serialization/JsonPolymorphicAttribute.xml @@ -92,7 +92,7 @@ System.String - Gets or sets a custom type discriminator property name for the polymorhic type. + Gets or sets a custom type discriminator property name for the polymorphic type. Uses the default '$type' property name if left unset. To be added. To be added. diff --git a/xml/System/Range.xml b/xml/System/Range.xml index 4968f332167..9b40dcbe5e2 100644 --- a/xml/System/Range.xml +++ b/xml/System/Range.xml @@ -353,7 +353,7 @@ int[] subArray2 = someArray[1..^0]; // { 2, 3, 4, 5 } ## Remarks -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. +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. ]]>