Include #nullable enable to generated files
See original GitHub issueI have some models being generated in a project that uses nullable reference types
The types generate fine, but I am getting CS8669 warnings because the generated file does not have #nullable enable included
Ex: public string? City { get; set; } gets generated but is marked as a warning
Adding this directive to the generated file would eliminate these warnings
Issue Analytics
- State:
- Created 2 years ago
- Reactions:7
- Comments:9 (1 by maintainers)
Top Results From Across the Web
Nullable reference types
Nullable reference types refers to a group of features enabled in a nullable aware context that minimize the likelihood that your code causes ......
Read more >Update your codebase to use nullable reference types
Nullable reference types enable you to declare if variables of a reference type should or shouldn't be assigned a null value.
Read more >The annotation for nullable reference types should only be ...
This element configures how the compiler interprets the nullability of types and what warnings are generated. Valid settings are: enable : The ...
Read more >Digging Into Nullable Reference Types in C#
Enabling Nullable Reference Types. In C# 8, they added the ability to enable Nullable Reference Types. There are two ways to enable it:...
Read more >Nullable Reference Types
These settings define how the compiler interprets the nullability of types and what warnings are generated. Nullable context is set in csproj file...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

+1 Getting this warning. And with
<WarningAsErrors>nullable</WarningAsErrors>, the tool breaks the build.@andrerav I’m just going to mention you here, not sure if you are subscribed to this issue.