msawczyn / EFDesigner2022

Entity Framework visual design surface and code-first code generation for EF6, Core and beyond
MIT License
119 stars 21 forks source link

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

Open Opzet opened 3 weeks ago

Opzet commented 3 weeks ago

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>