Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Opt-in Nullable Reference Types by default in templates #4138

Closed
hez2010 opened this issue Aug 23, 2019 · 7 comments
Closed

Opt-in Nullable Reference Types by default in templates #4138

hez2010 opened this issue Aug 23, 2019 · 7 comments

Comments

@hez2010
Copy link

hez2010 commented Aug 23, 2019

Opt-in Nullable Reference Types by default

Nullable Reference Types is a significant feature to decrease the possibility of bugs and it can improve robustness.
People who don't follow the Microsoft DevBlogs even don't know the existence of this feature, why not opt-in this feature in dotnet new template by default? If it was opted-in by default, new projects will consider the nullable issues, and in the future, most projects will not face the unexpected NullableReferenceException.

Solution

Make all existing templates in dotnet new opt-in Nullable Reference Types by default.

@tub5
Copy link

tub5 commented Aug 27, 2019

When C# 8 is released (not in preview mode), the Nullable element will be added by new project templates. Until then, you'll need to add it manually.
Found here

@safern
Copy link
Member

safern commented Sep 27, 2019

cc: @terrajobst @cartermp -- I believe this is the plan for .NET 5, or am I miss remembering?

@cartermp
Copy link
Contributor

This is the tentative plan, yes. But that is all going to depend on how we feel about the experience w.r.t first-party and third-party annotations and editor tooling.

@Gnbrkm41
Copy link

Gnbrkm41 commented Aug 4, 2020

Curious what the status on this is? It still seems to lack the feature by default.

Edit: Possibly pushed to .NET 6 - though it's not an official statement

@mairaw
Copy link

mairaw commented Aug 11, 2021

@jaredpar can you give an update here?

@scalablecory scalablecory transferred this issue from dotnet/core Nov 23, 2021
@vlada-shubina
Copy link
Member

This was implemented in #3359, suggesting to close - let me know if you have any objections.

@terrajobst
Copy link
Contributor

Thanks @vlada-shubina!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants