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
2 changes: 1 addition & 1 deletion docs/core/extensions/dependency-injection-basics.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ To get started, create a new .NET console application named **DI.Basics**. Some

- [Visual Studio: **File > New > Project**](/visualstudio/get-started/csharp/tutorial-console) menu.
- [Visual Studio Code](https://code.visualstudio.com/) and the [C# Dev Kit extension's](https://code.visualstudio.com/docs/csharp/project-management): **Solution Explorer** menu option.
- [.NET CLI: `dotnet new console`](/dotnet/core/tools/dotnet-new-sdk-templates#console) command in the terminal.
- [.NET CLI: `dotnet new console`](../tools/dotnet-new-sdk-templates.md#console) command in the terminal.

You need to add the package reference to the [Microsoft.Extensions.DependencyInjection](https://www.nuget.org/packages/Microsoft.Extensions.DependencyInjection) in the project file. Regardless of the approach, ensure the project resembles the following XML of the _DI.Basics.csproj_ file:

Expand Down
2 changes: 1 addition & 1 deletion docs/csharp/how-to/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ Events provide a mechanism to publish or subscribe to notifications.

- [Subscribe and unsubscribe from events](../programming-guide/events/how-to-subscribe-to-and-unsubscribe-from-events.md).
- [Implement events declared in interfaces](../programming-guide/events/how-to-implement-interface-events.md).
- [Conform to .NET guidelines when your code publishes events](../programming-guide/events/how-to-publish-events-that-conform-to-net-framework-guidelines.md).
- [Conform to .NET guidelines when your code publishes events](/dotnet/standard/events).
- [Raise events defined in base classes from derived classes](../programming-guide/events/how-to-raise-base-class-events-in-derived-classes.md).
- [Implement custom event accessors](../programming-guide/events/how-to-implement-custom-event-accessors.md).

Expand Down
2 changes: 1 addition & 1 deletion docs/csharp/language-reference/keywords/event.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ The `event` keyword is used to declare an event in a publisher class.

## Example

The following example shows how to declare and raise an event that uses <xref:System.EventHandler> as the underlying delegate type. For the complete code example that also shows how to use the generic <xref:System.EventHandler%601> delegate type and how to subscribe to an event and create an event handler method, see [How to publish events that conform to .NET Guidelines](../../programming-guide/events/how-to-publish-events-that-conform-to-net-framework-guidelines.md).
The following example shows how to declare and raise an event that uses <xref:System.EventHandler> as the underlying delegate type. For the complete code example that also shows how to use the generic <xref:System.EventHandler%601> delegate type and how to subscribe to an event and create an event handler method, see [How to publish events that conform to .NET Guidelines](/dotnet/standard/events).

[!code-csharp[csrefKeywordsModifiers#7](~/samples/snippets/csharp/VS_Snippets_VBCSharp/csrefKeywordsModifiers/CS/csrefKeywordsModifiers.cs#7)]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,6 @@ You cannot easily unsubscribe from an event if you used an anonymous function to

- [Events](./index.md)
- [event](../../language-reference/keywords/event.md)
- [How to publish events that conform to .NET Guidelines](./how-to-publish-events-that-conform-to-net-framework-guidelines.md)
- [How to publish events that conform to .NET Guidelines](/dotnet/standard/events)
- [- and -= operators](../../language-reference/operators/subtraction-operator.md)
- [+ and += operators](../../language-reference/operators/addition-operator.md)
2 changes: 1 addition & 1 deletion docs/csharp/programming-guide/events/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ In a typical C# Windows Forms or Web application, you subscribe to events raised

- [How to subscribe to and unsubscribe from events](./how-to-subscribe-to-and-unsubscribe-from-events.md)

- [How to publish events that conform to .NET Guidelines](./how-to-publish-events-that-conform-to-net-framework-guidelines.md)
- [How to publish events that conform to .NET Guidelines](/dotnet/standard/events)

- [How to raise base class events in derived classes](./how-to-raise-base-class-events-in-derived-classes.md)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ In most common scenario, the type is annotated with `[Serializable]` and the ser

### C# auto properties

For C# [auto-implemented properties](/dotnet/csharp/programming-guide/classes-and-structs/auto-implemented-properties) (`{ get; set; }`), BinaryFormatter will serialize the backing fields that are generated by the C# compiler, not the properties. The names of those serialized backing fields contain illegal C# characters and cannot be controlled. A C# decompiler (such as [https://sharplab.io/](https://sharplab.io/) or [ILSpy](https://github.com/icsharpcode/ILSpy)) can demonstrate how C# auto properties are presented to the runtime.
For C# [auto-implemented properties](../../../csharp/programming-guide/classes-and-structs/auto-implemented-properties.md) (`{ get; set; }`), BinaryFormatter will serialize the backing fields that are generated by the C# compiler, not the properties. The names of those serialized backing fields contain illegal C# characters and cannot be controlled. A C# decompiler (such as [https://sharplab.io/](https://sharplab.io/) or [ILSpy](https://github.com/icsharpcode/ILSpy)) can demonstrate how C# auto properties are presented to the runtime.

```csharp
[Serializable]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ helpviewer_keywords:

## BinaryFormatter removal

Starting with .NET 9, [BinaryFormatter] is no longer supported due to its known [security risks](/dotnet/standard/serialization/binaryformatter-security-guide) and its APIs always throw a <xref:System.PlatformNotSupportedException> for all project types, including Windows Forms apps. For more information about the risks BinaryFormatter poses and the reason for its removal, see the [BinaryFormatter migration guide](index.md).
Starting with .NET 9, [BinaryFormatter] is no longer supported due to its known [security risks](../binaryformatter-security-guide.md) and its APIs always throw a <xref:System.PlatformNotSupportedException> for all project types, including Windows Forms apps. For more information about the risks BinaryFormatter poses and the reason for its removal, see the [BinaryFormatter migration guide](index.md).

With BinaryFormatter's removal, it's expected that many Windows Forms applications will be impacted, and you'll need to take action to complete your migration to .NET 9 or a later version.

Expand Down Expand Up @@ -91,7 +91,7 @@ For types that aren't intrinsically handled during serialization into resources,
.NET 9 users who can't migrate away from [BinaryFormatter] can install an unsupported compatibility package. For more information, see [BinaryFormatter migration guide: Compatibility Package](compatibility-package.md).

> [!CAUTION]
> BinaryFormatter is dangerous and not recommended as it puts consuming apps at risk for attacks such as denial of service (DoS), information disclosure, or remote code execution. For more information about the risks [BinaryFormatter] poses, see [Deserialization risks in use of BinaryFormatter and related types](/dotnet/standard/serialization/binaryformatter-security-guide).
> BinaryFormatter is dangerous and not recommended as it puts consuming apps at risk for attacks such as denial of service (DoS), information disclosure, or remote code execution. For more information about the risks [BinaryFormatter] poses, see [Deserialization risks in use of BinaryFormatter and related types](../binaryformatter-security-guide.md).

## Issues

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ helpviewer_keywords:

## BinaryFormatter removal

Starting with .NET 9, [BinaryFormatter] is no longer supported due to its known [security risks](/dotnet/standard/serialization/binaryformatter-security-guide) and its APIs always throw a <xref:System.PlatformNotSupportedException> for all project types, including WPF apps. For more information about the risks [BinaryFormatter] poses and the reason for its removal, see the [BinaryFormatter migration guide](index.md).
Starting with .NET 9, [BinaryFormatter] is no longer supported due to its known [security risks](../binaryformatter-security-guide.md) and its APIs always throw a <xref:System.PlatformNotSupportedException> for all project types, including WPF apps. For more information about the risks [BinaryFormatter] poses and the reason for its removal, see the [BinaryFormatter migration guide](index.md).

With [BinaryFormatter]’s removal, it's expected that many WPF applications will be impacted, and you'll need to take action to complete your migration to .NET 9 or a later version.

Expand Down Expand Up @@ -64,7 +64,7 @@ Ref: [DataStream.cs](https://github.com/dotnet/wpf/blob/4e977f5fe8c73094ee5826db
.NET 9 users who can't migrate away from [BinaryFormatter] can install an unsupported compatibility package. For more information, see [BinaryFormatter migration guide: Compatibility Package](compatibility-package.md).

> [!CAUTION]
> [BinaryFormatter] is dangerous and not recommended as it puts consuming apps at risk for attacks such as denial of service (DoS), information disclosure, or remote code execution. For more information about the risks [BinaryFormatter] poses, see [Deserialization risks in use of BinaryFormatter and related types](/dotnet/standard/serialization/binaryformatter-security-guide).
> [BinaryFormatter] is dangerous and not recommended as it puts consuming apps at risk for attacks such as denial of service (DoS), information disclosure, or remote code execution. For more information about the risks [BinaryFormatter] poses, see [Deserialization risks in use of BinaryFormatter and related types](../binaryformatter-security-guide.md).

### Issues

Expand Down