Skip to content

Configuration binding source generator fails to compile with CS8600 when using nullable reference types #89019

Description

@martincostello

Description

When enabling the configuration binding source generator for a project where nullable types are used, compilation fails with an CS8600 error.

Project\src\Project\Microsoft.Extensions.Configuration.Binder.SourceGeneration\Microsoft.Extensions.Configuration.Binder.SourceGeneration.ConfigurationBindingGenerator\GeneratedConfigurationBinder.g.cs(1070,53): error CS8600: Converting null literal or possible null value to non-nullable type. [Project\src\Project\Project.csproj]

Reproduction Steps

  1. Clone and checkout any of the following commits:
  2. Run build.ps1

Expected behavior

The applications compile and the tests pass.

Actual behavior

The applications fail to compile with CS8600 errors.

Regression?

No.

Known Workarounds

None.

Configuration

.NET SDK 8.0.100-preview.6.23330.14

Other information

No response

Metadata

Metadata

Assignees

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions