question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Include #nullable enable to generated files

See original GitHub issue

I 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:closed
  • Created 2 years ago
  • Reactions:7
  • Comments:9 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
kcaddukcommented, Jul 6, 2022

+1 Getting this warning. And with <WarningAsErrors>nullable</WarningAsErrors>, the tool breaks the build.

0reactions
cyril265commented, Sep 16, 2022

@andrerav I’m just going to mention you here, not sure if you are subscribed to this issue.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found