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

Please add to FAQ : How to avoid #nullable enable Find and Replace with net48 and vs2022 #106

Open
Opzet opened this issue Jun 14, 2024 · 0 comments

Comments

@Opzet
Copy link
Contributor

Opzet commented Jun 14, 2024

This is how to get around annoying find and replace of

#nullable enable

If you're using .NET Framework 4.8 and want to manage nullable reference types, it's important to note that the full nullable reference types feature is not directly supported as it is a C# 8.0 feature, primarily designed for use with .NET Core 3.0 and above.
However, you can still enable or disable it in .NET Framework 4.8 projects by using the latest C# compiler (which supports C# 8.0 features) and setting up your project file appropriately. Unload .csproj and add this to your .csproj (or update to SDK style)

  <PropertyGroup>
<LangVersion>8.0</LangVersion>
<!-- Ensures C# 8.0 compatibility -->
<Nullable>disable</Nullable>
<!-- Disable nullable reference types -->
</PropertyGroup>
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

1 participant