-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Closed
Labels
area-minimalIncludes minimal APIs, endpoint filters, parameter binding, request delegate generator etcIncludes minimal APIs, endpoint filters, parameter binding, request delegate generator etcfeature-rdg
Milestone
Description
Is there an existing issue for this?
- I have searched the existing issues
Describe the bug
If an application does not use nullable reference types but does use the request delegate generator, the application fails to compile due to RDG emitting code with nullable annotations.
Expected Behavior
RDG does not emit nullable annotations if the project does not use nullable reference types.
Steps To Reproduce
- Clone the martincostello/SignInWithAppleSample repository.
- Checkout the martincostello/SignInWithAppleSample@4c6ea88 commit.
- Run
dotnet buildfrom the root of the repository.
Exceptions (if any)
Example error:
❯ dotnet build
MSBuild version 17.10.0-preview-24101-01+07fd5d51f for .NET
Restore complete (1.0s)
You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy
SignInWithApple failed with errors (1.3s)
C:\Coding\martincostello\SignInWithAppleSample\src\SignInWithApple\Microsoft.AspNetCore.Http.RequestDelegateGenerator\Microsoft.AspNetCore.Http.RequestDelegateGenerator.RequestDelegateGenerator\GeneratedRouteBuilderExtensions.g.cs(281,32): error CS8669: The annotation for nullable reference types should only be used in code within a '#nullable' annotations context. Auto-generated code requires an explicit '#nullable' directive in source. [C:\Coding\martincostello\SignInWithAppleSample\src\SignInWithApple\SignInWithApple.csproj].NET Version
9.0.100-preview.1.24101.2
Anything else?
No response
Metadata
Metadata
Assignees
Labels
area-minimalIncludes minimal APIs, endpoint filters, parameter binding, request delegate generator etcIncludes minimal APIs, endpoint filters, parameter binding, request delegate generator etcfeature-rdg