Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Library</OutputType>
<TargetFramework>net6.0</TargetFramework>
</PropertyGroup>

</Project>
22 changes: 11 additions & 11 deletions snippets/csharp/System.Security/SecureString/AppendChar/xat.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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
//</snippet1>
// The current length of the SecureString object: 0
//</snippet1>
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
</PropertyGroup>

</Project>
20 changes: 10 additions & 10 deletions snippets/visualbasic/VS_Snippets_CLR/SecureString.xAt/VB/xat.vb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
'</snippet1>
' The current length of the SecureString object: 0
'</snippet1>
14 changes: 11 additions & 3 deletions xml/System.Diagnostics/Debugger.xml
Original file line number Diff line number Diff line change
Expand Up @@ -218,9 +218,17 @@ Console.WriteLine("Hello, world.");
<Parameter Name="exception" Type="System.Exception" Index="0" FrameworkAlternate="net-9.0" />
</Parameters>
<Docs>
<param name="exception">To be added.</param>
<summary>To be added.</summary>
<remarks>To be added.</remarks>
<param name="exception">The user-unhandled exception.</param>
<summary>
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.
</summary>
<remarks>
<format type="text/markdown"><![CDATA[

## Remarks
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.
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="DefaultCategory">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,39 @@
</Attribute>
</Attributes>
<Docs>
<summary>To be added.</summary>
<remarks>To be added.</remarks>
<summary>
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.
</summary>
<remarks>
<format type="text/markdown"><![CDATA[

## Remarks
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)>.

## Example

```csharp
[MethodImpl(MethodImplOptions.NoInlining)]
[DebuggerDisableUserUnhandledExceptions]
static async Task InvokeUserCode(Func<Task> 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.
}
}
```
]]></format>
</remarks>
</Docs>
<Members>
<Member MemberName=".ctor">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
<ReturnType>System.String</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets a custom type discriminator property name for the polymorhic type.
<summary>Gets or sets a custom type discriminator property name for the polymorphic type.
Uses the default '$type' property name if left unset.</summary>
<value>To be added.</value>
<remarks>To be added.</remarks>
Expand Down
2 changes: 1 addition & 1 deletion xml/System/Range.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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.

]]></format>
</remarks>
Expand Down