The setting also needs to be enabled at the project level under the Build tab.
This is in Visual Studio 2019.