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
8 changes: 4 additions & 4 deletions .openpublishing.redirection.csharp.json
Original file line number Diff line number Diff line change
Expand Up @@ -1328,7 +1328,7 @@
},
{
"source_path_from_root": "/docs/csharp/programming-guide/concepts/attributes/index.md",
"redirect_url": "/dotnet/csharp/advanced-concepts/reflection-and-attributes"
"redirect_url": "/dotnet/csharp/advanced-topics/reflection-and-attributes/"
},
{
"source_path_from_root": "/docs/csharp/programming-guide/concepts/attributes/attributeusage.md",
Expand All @@ -1340,15 +1340,15 @@
},
{
"source_path_from_root": "/docs/csharp/programming-guide/concepts/attributes/creating-custom-attributes.md",
"redirect_url": "/dotnet/csharp/advanced-concepts/reflection-and-attributes/creating-custom-attributes"
"redirect_url": "/dotnet/csharp/advanced-topics/reflection-and-attributes/creating-custom-attributes"
},
{
"source_path_from_root": "/docs/csharp/programming-guide/concepts/attributes/accessing-attributes-by-using-reflection.md",
"redirect_url": "/dotnet/csharp/advanced-concepts/reflection-and-attributes/accessing-attributes-by-using-reflection"
"redirect_url": "/dotnet/csharp/advanced-topics/reflection-and-attributes/accessing-attributes-by-using-reflection"
},
{
"source_path_from_root": "/docs/csharp/programming-guide/concepts/attributes/how-to-create-a-c-cpp-union-by-using-attributes.md",
"redirect_url": "/dotnet/csharp/advanced-concepts/reflection-and-attributes/how-to-create-a-c-cpp-union-by-using-attributes"
"redirect_url": "/dotnet/csharp/advanced-topics/reflection-and-attributes/how-to-create-a-c-cpp-union-by-using-attributes"
},
{
"source_path_from_root": "/docs/csharp/programming-guide/concepts/caller-information.md",
Expand Down
6 changes: 3 additions & 3 deletions docs/azure/includes/dotnet-all.md
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@
| Azure.Communication.Administration | NuGet [1.0.0-beta.3](https://www.nuget.org/packages/Azure.Communication.Administration/1.0.0-beta.3) | | |
| Azure.Communication.Calling | NuGet [1.0.0-beta.36](https://www.nuget.org/packages/Azure.Communication.Calling/1.0.0-beta.36) | | |
| Azure.Communication.CallingServer | NuGet [1.0.0-beta.3](https://www.nuget.org/packages/Azure.Communication.CallingServer/1.0.0-beta.3) | | |
| Azure.Communication.Email | NuGet [1.0.0-beta.3](https://www.nuget.org/packages/Azure.Communication.Email/1.0.0-beta.3) | | |
| Azure.Communication.Email | NuGet [1.0.0-beta.4](https://www.nuget.org/packages/Azure.Communication.Email/1.0.0-beta.4) | | |
| Azure.Core.Expressions.DataFactory | NuGet [1.0.0-beta.1](https://www.nuget.org/packages/Azure.Core.Expressions.DataFactory/1.0.0-beta.1) | | |
| Azure.Quantum.Jobs | NuGet [1.0.0-beta.3](https://www.nuget.org/packages/Azure.Quantum.Jobs/1.0.0-beta.3) | | |
| Azure.Storage.DataMovement.Blobs | NuGet [12.0.0-beta.1](https://www.nuget.org/packages/Azure.Storage.DataMovement.Blobs/12.0.0-beta.1) | | |
Expand Down Expand Up @@ -508,7 +508,7 @@
| Extensions - Caching Cosmos | NuGet [1.4.0](https://www.nuget.org/packages/Microsoft.Extensions.Caching.Cosmos/1.4.0) | | GitHub [1.4.0](https://github.com/Azure/Microsoft.Extensions.Caching.Cosmos/tree/v1.0.0-preview4) |
| Functions extension for Application Insights | NuGet [1.0.0-preview4](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.ApplicationInsights/1.0.0-preview4) | | |
| Functions extension for Authentication Events | NuGet [1.0.0-beta.3](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.AuthenticationEvents/1.0.0-beta.3) | | |
| Functions extension for Azure SQL and SQL Server | NuGet [1.0.122-preview](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.Sql/1.0.122-preview) | | |
| Functions extension for Azure SQL and SQL Server | NuGet [3.0.143-preview](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.Sql/3.0.143-preview) | | |
| Functions extension for Durable Task Framework - isolated worker | NuGet [1.0.0](https://www.nuget.org/packages/Microsoft.Azure.Functions.Worker.Extensions.DurableTask/1.0.0) | | |
| Functions extension for Storage Timers | NuGet [1.0.0-beta.1](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.Timers.Storage/1.0.0-beta.1) | | |
| Microsoft.Azure.Cosmos.Templates | NuGet [1.0.0](https://www.nuget.org/packages/Microsoft.Azure.Cosmos.Templates/1.0.0) | | |
Expand All @@ -528,7 +528,7 @@
| Microsoft.Azure.Functions.Worker.Extensions.SendGrid | NuGet [3.0.3](https://www.nuget.org/packages/Microsoft.Azure.Functions.Worker.Extensions.SendGrid/3.0.3) | | |
| Microsoft.Azure.Functions.Worker.Extensions.ServiceBus | NuGet [5.7.0](https://www.nuget.org/packages/Microsoft.Azure.Functions.Worker.Extensions.ServiceBus/5.7.0) | | |
| Microsoft.Azure.Functions.Worker.Extensions.SignalRService | NuGet [1.7.0](https://www.nuget.org/packages/Microsoft.Azure.Functions.Worker.Extensions.SignalRService/1.7.0) | | |
| Microsoft.Azure.Functions.Worker.Extensions.Sql | NuGet [1.0.122-preview](https://www.nuget.org/packages/Microsoft.Azure.Functions.Worker.Extensions.Sql/1.0.122-preview) | | |
| Microsoft.Azure.Functions.Worker.Extensions.Sql | NuGet [3.0.143-preview](https://www.nuget.org/packages/Microsoft.Azure.Functions.Worker.Extensions.Sql/3.0.143-preview) | | |
| Microsoft.Azure.Functions.Worker.Extensions.Storage | NuGet [5.0.1](https://www.nuget.org/packages/Microsoft.Azure.Functions.Worker.Extensions.Storage/5.0.1)<br>NuGet [5.1.0-preview1](https://www.nuget.org/packages/Microsoft.Azure.Functions.Worker.Extensions.Storage/5.1.0-preview1) | | |
| Microsoft.Azure.Functions.Worker.Extensions.Storage.Blobs | NuGet [5.0.1](https://www.nuget.org/packages/Microsoft.Azure.Functions.Worker.Extensions.Storage.Blobs/5.0.1)<br>NuGet [5.1.0-preview1](https://www.nuget.org/packages/Microsoft.Azure.Functions.Worker.Extensions.Storage.Blobs/5.1.0-preview1) | | |
| Microsoft.Azure.Functions.Worker.Extensions.Storage.Queues | NuGet [5.0.0](https://www.nuget.org/packages/Microsoft.Azure.Functions.Worker.Extensions.Storage.Queues/5.0.0) | | |
Expand Down
2 changes: 1 addition & 1 deletion docs/breadcrumb/toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ items:
topicHref: /dotnet/csharp/asynchronous-programming/index
- name: Advanced concepts
tocHref: /dotnet/csharp/advanced-topics
topicHref: /dotnet/csharp/advanced-topics/index
topicHref: /dotnet/csharp/advanced-topics/reflection-and-attributes/index

- name: Tutorials
tocHref: /dotnet/csharp/tutorials/
Expand Down
19 changes: 10 additions & 9 deletions docs/core/compatibility/8.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,13 @@ If you're migrating an app to .NET 8, the breaking changes listed here might aff

## Windows Forms

| Title | Type of change | Introduced |
| ------------------------------------------------------------------------------------------------------ | ------------------- | ---------- |
| [Anchor layout changes](windows-forms/8.0/anchor-layout.md) | Behavioral change | Preview 1 |
| [ExceptionCollection ctor throws ArgumentException](windows-forms/8.0/exceptioncollection.md) | Behavioral change | Preview 1 |
| [Forms scale according to AutoScaleMode](windows-forms/8.0/top-level-window-scaling.md) | Behavioral change | Preview 1 |
| [ImageList.ColorDepth default is Depth32Bit](windows-forms/8.0/imagelist-colordepth.md) | Behavioral change | Preview 1 |
| [TableLayoutStyleCollection throws ArgumentException](windows-forms/8.0/tablelayoutstylecollection.md) | Behavioral change | Preview 1 |
| [Top-level forms scale minimum and maximum size to DPI](windows-forms/8.0/forms-scale-size-to-dpi.md) | Behavioral change | Preview 1 |
| [WFDEV002 obsoletion is now an error](windows-forms/8.0/domainupdownaccessibleobject.md) | Source incompatible | Preview 1 |
| Title | Type of change | Introduced |
| -------------------------------------------------------------------------------------------------------- | ------------------- | ---------- |
| [Anchor layout changes](windows-forms/8.0/anchor-layout.md) | Behavioral change | Preview 1 |
| [DefaultValueAttribute removed from some properties](windows-forms/8.0/defaultvalueattribute-removal.md) | Behavioral change | Preview 2 |
| [ExceptionCollection ctor throws ArgumentException](windows-forms/8.0/exceptioncollection.md) | Behavioral change | Preview 1 |
| [Forms scale according to AutoScaleMode](windows-forms/8.0/top-level-window-scaling.md) | Behavioral change | Preview 1 |
| [ImageList.ColorDepth default is Depth32Bit](windows-forms/8.0/imagelist-colordepth.md) | Behavioral change | Preview 1 |
| [TableLayoutStyleCollection throws ArgumentException](windows-forms/8.0/tablelayoutstylecollection.md) | Behavioral change | Preview 1 |
| [Top-level forms scale minimum and maximum size to DPI](windows-forms/8.0/forms-scale-size-to-dpi.md) | Behavioral change | Preview 1 |
| [WFDEV002 obsoletion is now an error](windows-forms/8.0/domainupdownaccessibleobject.md) | Source incompatible | Preview 1 |
4 changes: 4 additions & 0 deletions docs/core/compatibility/toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ items:
items:
- name: Anchor layout changes
href: windows-forms/8.0/anchor-layout.md
- name: DefaultValueAttribute removed from some properties
href: windows-forms/8.0/defaultvalueattribute-removal.md
- name: ExceptionCollection ctor throws ArgumentException
href: windows-forms/8.0/exceptioncollection.md
- name: Forms scale according to AutoScaleMode
Expand Down Expand Up @@ -1422,6 +1424,8 @@ items:
items:
- name: Anchor layout changes
href: windows-forms/8.0/anchor-layout.md
- name: DefaultValueAttribute removed from some properties
href: windows-forms/8.0/defaultvalueattribute-removal.md
- name: ExceptionCollection ctor throws ArgumentException
href: windows-forms/8.0/exceptioncollection.md
- name: Forms scale according to AutoScaleMode
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
title: "Breaking change: DefaultValueAttribute removed from some properties"
description: Learn about the breaking change in .NET 8 for Windows Forms where DefaultValueAttribute was removed from properties whose default values must be dynamically calculated.
ms.date: 03/13/2023
---
# DefaultValueAttribute removed from some properties

<xref:System.ComponentModel.DefaultValueAttribute> has been removed from control properties that are dependent on the default font height.

## Version introduced

.NET 8

## Previous behavior

The affected properties were decorated with <xref:System.ComponentModel.DefaultValueAttribute>, and default values were hardcoded according to an assumed application-wide font.

## New behavior

Starting in .NET 8, the attribute is removed from certain properties. Design-time default values are calculated at startup based on the current font metrics.

## Change category

This change is a [*behavioral change*](../../categories.md#behavioral-change).

## Reason for change

The <xref:System.ComponentModel.DefaultValueAttribute> attribute is designed to define constant default values used by the Windows Forms designer. In the past, this attribute was used to specify defaults on certain properties that depend on the current font height. A new default font was introduced in .NET Core 3.1, but the attribute values weren't updated accordingly. Moreover, there's now an API to modify application font. Thus, it makes sense to use dynamic default values instead of constant ones.

The designer provides methods to specify dynamic default values, however, for properties decorated with <xref:System.ComponentModel.DefaultValueAttribute>, it always uses the constant default value instead. The methods for specifying dynamic defaults preserve the design-time functionality provided by the attribute.

## Recommended action

<xref:System.ComponentModel.DefaultValueAttribute> is intended for internal use in design-time scenarios. You shouldn't use it in other scenarios.

## Affected APIs

The following table lists the affected properties.

| Property | Change version |
|-|-|-|
| <xref:System.Windows.Forms.DataGridViewRow.Height?displayProperty=fullName> | Preview 2 |
| <xref:System.Windows.Forms.ListBox.ItemHeight?displayProperty=fullName> | Preview 2 |
3 changes: 2 additions & 1 deletion docs/core/extensions/httpclient-http3.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ ms.date: 7/28/2022

# Use HTTP/3 with HttpClient

[HTTP/3](https://www.rfc-editor.org/rfc/rfc9114.html) is the third and recently standardized major version of HTTP. HTTP/3 uses the same semantics as HTTP/1.1 and HTTP/2: the same request methods, status codes, and message fields apply to all versions. The differences are in the underlying transport. Both HTTP/1.1 and HTTP/2 use TCP as their transport. HTTP/3 uses a new transport technology developed alongside HTTP/3 called [QUIC](https://www.rfc-editor.org/rfc/rfc9000.html).
[HTTP/3](https://www.rfc-editor.org/rfc/rfc9114.html) is the third and recently standardized major version of HTTP. HTTP/3 uses the same semantics as HTTP/1.1 and HTTP/2: the same request methods, status codes, and message fields apply to all versions. The differences are in the underlying transport. Both HTTP/1.1 and HTTP/2 use TCP as their transport. HTTP/3 uses a transport technology developed alongside HTTP/3 called [QUIC](https://www.rfc-editor.org/rfc/rfc9000.html).

HTTP/3 and QUIC have a number of benefits compared to HTTP/1.1 and HTTP/2:

Expand Down Expand Up @@ -90,5 +90,6 @@ Cloudflare hosts a site for HTTP/3 which can be used to test the client against

- <xref:System.Net.Http.HttpClient>
- [HTTP/3 support in Kestrel][http3Kestrel]
- [QUIC support in .NET](../../fundamentals/networking/quic/quic-overview.md)

[http3Kestrel]: /aspnet/core/fundamentals/servers/kestrel/http3
2 changes: 1 addition & 1 deletion docs/csharp/language-reference/compiler-messages/cs0592.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@ public class A

## See also

- [Attributes](/dotnet/csharp/advanced-concepts/reflection-and-attributes)
- [Attributes](/dotnet/csharp/advanced-topics/reflection-and-attributes)
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ For more information about indexers, see [Indexers](../../programming-guide/inde

For information about pointer element access, see the [Pointer element access operator []](pointer-related-operators.md#pointer-element-access-operator-) section of the [Pointer related operators](pointer-related-operators.md) article.

You also use square brackets to specify [attributes](/dotnet/csharp/advanced-concepts/reflection-and-attributes):
You also use square brackets to specify [attributes](/dotnet/csharp/advanced-topics/reflection-and-attributes):

```csharp
[System.Diagnostics.Conditional("DEBUG")]
Expand Down
2 changes: 1 addition & 1 deletion docs/csharp/language-reference/operators/nameof.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ You can use a `nameof` expression to make the argument-checking code more mainta

[!code-csharp[nameof and argument check](snippets/shared/NameOfOperator.cs#ExceptionMessage)]

Beginning with C# 11, you can use a `nameof` expression with a method parameter inside an [attribute](/dotnet/csharp/advanced-concepts/reflection-and-attributes) on a method or its parameter. The following code shows how to do that for an attribute on a method, a local function, and the parameter of a lambda expression:
Beginning with C# 11, you can use a `nameof` expression with a method parameter inside an [attribute](/dotnet/csharp/advanced-topics/reflection-and-attributes) on a method or its parameter. The following code shows how to do that for an attribute on a method, a local function, and the parameter of a lambda expression:

:::code language="csharp" source="snippets/shared/NameOfOperator.cs" id="SnippetNameOfParameter":::

Expand Down
2 changes: 1 addition & 1 deletion docs/csharp/misc/cs0182.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Certain restrictions apply to what kinds of arguments may be used with attribute

- [decimal](../language-reference/builtin-types/floating-point-numeric-types.md)

For more information, see [Attributes](/dotnet/csharp/advanced-concepts/reflection-and-attributes).
For more information, see [Attributes](/dotnet/csharp/advanced-topics/reflection-and-attributes).

## Example

Expand Down
2 changes: 1 addition & 1 deletion docs/csharp/misc/cs0643.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ ms.assetid: beae30ff-15c2-413f-8f5c-504cdba2e57a

'arg' duplicate named attribute argument

A parameter, `arg`, on a user-defined attribute was specified twice. For more information, see [Attributes](/dotnet/csharp/advanced-concepts/reflection-and-attributes).
A parameter, `arg`, on a user-defined attribute was specified twice. For more information, see [Attributes](/dotnet/csharp/advanced-topics/reflection-and-attributes).

## Example

Expand Down
2 changes: 1 addition & 1 deletion docs/csharp/misc/cs0655.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ ms.assetid: 8ce340e2-eeeb-476a-8609-ab4bbaf10c44

'parameter' is not a valid named attribute argument because it is not a valid attribute parameter type

See [Attributes](/dotnet/csharp/advanced-concepts/reflection-and-attributes) for a discussion of valid parameter types for an attribute.
See [Attributes](/dotnet/csharp/advanced-topics/reflection-and-attributes) for a discussion of valid parameter types for an attribute.

## Example

Expand Down
2 changes: 1 addition & 1 deletion docs/csharp/misc/cs0657.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ ms.assetid: d12d2efc-f44e-40e6-b825-5a66ead0c08e

'attribute modifier' is not a valid attribute location for this declaration. Valid attribute locations for this declaration are 'locations'. All attributes in this block will be ignored.

The compiler found an attribute modifier in an invalid location. See [Attribute Targets](/dotnet/csharp/advanced-concepts/reflection-and-attributes#attribute-targets) for more information.
The compiler found an attribute modifier in an invalid location. See [Attribute Targets](/dotnet/csharp/advanced-topics/reflection-and-attributes#attribute-targets) for more information.

The following sample generates CS0657:

Expand Down
2 changes: 1 addition & 1 deletion docs/csharp/misc/cs0658.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ ms.assetid: 0309074c-741a-492c-9370-73b4bbfd3c1a

'attribute modifier' is not a recognized attribute location. All attributes in this block will be ignored.

An invalid attribute modifier was specified. See [Attribute Targets](/dotnet/csharp/advanced-concepts/reflection-and-attributes#attribute-targets) for more information.
An invalid attribute modifier was specified. See [Attribute Targets](/dotnet/csharp/advanced-topics/reflection-and-attributes#attribute-targets) for more information.

The following sample generates CS0658:

Expand Down
2 changes: 1 addition & 1 deletion docs/csharp/misc/cs1730.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ class Test

## See also

- [Attributes](/dotnet/csharp/advanced-concepts/reflection-and-attributes)
- [Attributes](/dotnet/csharp/advanced-topics/reflection-and-attributes)
2 changes: 1 addition & 1 deletion docs/csharp/programming-guide/concepts/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ This section explains programming concepts in the C# language.
|Title|Description|
|-----------|-----------------|
|[Assemblies in .NET](../../../standard/assembly/index.md)|Describes how to create and use assemblies.|
|[Attributes (C#)](/dotnet/csharp/advanced-concepts/reflection-and-attributes)|Discusses how to provide additional information about programming elements such as types, fields, methods, and properties by using attributes.|
|[Attributes (C#)](/dotnet/csharp/advanced-topics/reflection-and-attributes)|Discusses how to provide additional information about programming elements such as types, fields, methods, and properties by using attributes.|
|[Collections (C#)](./collections.md)|Describes some of the types of collections provided by .NET. Demonstrates how to use simple collections and collections of key/value pairs.|
|[Covariance and Contravariance (C#)](./covariance-contravariance/index.md)|Shows how to enable implicit conversion of generic type parameters in interfaces and delegates.|
|[Expression Trees (C#)](../../advanced-topics/expression-trees/index.md)|Explains how you can use expression trees to enable dynamic modification of executable code.|
Expand Down
2 changes: 1 addition & 1 deletion docs/csharp/programming-guide/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ This section provides detailed information on key C# language features and featu

[Assemblies in .NET](../../standard/assembly/index.md)

[Attributes](/dotnet/csharp/advanced-concepts/reflection-and-attributes)
[Attributes](/dotnet/csharp/advanced-topics/reflection-and-attributes)

[Collections](./concepts/collections.md)

Expand Down
Loading