Persist compile flags (or at least 'Nullable') into the generated csproj

I have been trying (unsuccessfully) for hours to enable the ‘Nullable’ reference types for c#. Unity allows adding compiler flags in Project Settings > Player > Additional Compiler Arguments, but those settings are not persisted to the csproj generated by the editor. This means that visual studio and vscode won’t see this change. Before, you could add a Directory.Beuild.props file to handle this, but that doesn’t seem to work in VS2022 anymore (see How to enable nullable reference types in VS 2022 )

It would be nice if features like Nullable could be set in the editor and persisted into the csproj so all this hackery and googling could be avoided.

After looking into things a bit, not sure this would actually help. It appears that IntelliSense’s framework 4.7.1 implementation won’t ever support nullable…? For more info, see How to enable nullable reference types in VS 2022