Description
In every one of our templates since .NET 6 we have now defaulted to include the ImplicitUsings
and Nullable
settings as opted-in:
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
This now feels like unnecessary boilerplate code for the modern frameworks and getting toward less verbose settings and more toward opinionated views of the platform/SDK defaults. The time feels right now for .NET 10 to move these settings into the default targets and remove from project templates. When you look at new flows as well as people approach C#, these additional settings -- which we default opt them into -- become learning stumbling blocks of why they are there if they are preferred for greenfield/new situations. In our single-file run capabilities in .NET 10 for example, you move from a single simple .cs file and with dotnet project convert
you get the expected csproj file, but now new properties that you have no idea where they were before, why you now have to know about them when you didn't before, etc.
These should now be the default path forward for modern C# development.
Impact Concerns
This likely will cause WarningsAsErrors
impact as without TFM-targeted changes this would be an upgrade breaking change, but only in new scenarios. Existing properties set would/should be honored still with the local csproj setting overriding the target. Someone who simply removed the property rather than set it do disabled
for an example would now be more impacted.
Ideally if a if (TFM>=net10.0)
could be applied in the targets this would help mitigate, but not help with cleaning the template experiences removing boilerplate.