Skip to content

Changes to Nullable Reference Type Annotations in .NET 6.0 #444

Open
@pranavkm

Description

@pranavkm

Changes to Nullable Reference Type Annotations in .NET 6.0

This issue represents a work-in-progress. All breaking changes to nullability annotations will be aggregated into this issue throughout the course of .NET 6.0.

Starting in .NET 5.0, we have been applying nullability annotations to parts of ASP.NET Core. From the outset of this effort, we anticipated that mistakes would be made in these annotations and fixes would need to be made. In .NET 6.0, we are updating some annotations that have been previously applied. Some of these changes are considered source breaking changes because it leads to the APIs being incompatible or more restrictive, or could result in build-time warnings when used in projects that have nullable reference types enabled.

Please use dotnet/aspnetcore#27564 for further discussions.

Version introduced

.NET 6.0

Old behavior

The affected APIs had incorrect nullable reference type annotations and build warnings were either absent or incorrect.

New behavior

New build warnings will be produced and incorrect build warnings will no longer be produced for the affected APIs.

Reason for change

Through feedback and further testing, the nullable annotations for the affected APIs were determined to be inaccurate. The updated annotations now correctly represent the nullability contracts for the APIs.

Recommended action

Update code calling these APIs to reflect the revised nullability contracts.

Category

ASP.NET

Affected APIs


Issue metadata

  • Issue type: breaking-change

Metadata

Metadata

Assignees

No one assigned

    Labels

    6.0.0Breaking changeDocumentedThe breaking change has been published to the .NET Core docs

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions