Using backward-compatible build settings. The latest version of UE4 sets the following values by default

I’m getting this annoying message in output window in Visual Studio every time I compile project, here is the snapshot of relevant part of the message:

[Upgrade] Using backward-compatible
build settings. The latest version of
UE4 sets the following values by
default, which may require code
changes: [Upgrade]
bLegacyPublicIncludePaths = false
=> Omits subfolders from public include paths to reduce compiler
command line length. (Previously:
true). [Upgrade]
ShadowVariableWarningLevel =
WarningLevel.Error => Treats
shadowed variable warnings as errors.
(Previously: WarningLevel.Warning).
[Upgrade] PCHUsage =
PCHUsageMode.UseExplicitOrSharedPCHs
=> Set in build.cs files to enables IWYU-style PCH model. See
Include What You Use (IWYU) for Unreal Engine Programming | Unreal Engine 5.3 Documentation.
(Previously:
PCHUsageMode.UseSharedPCHs). [Upgrade]
Suppress this message by setting
‘DefaultBuildSettings =
BuildSettingsVersion.V2;’ in
SlateTestEditor.Target.cs, and
explicitly overriding settings that
differ from the new defaults.

obviously I can just add

DefaultBuildSettings =
BuildSettingsVersion.V2.

into build.cs file but but,
shouldn’t this new settings be default somehow, instead of specifiying defaults manually?

Same Here.

I add

DefaultBuildSettings = BuildSettingsVersion.V2.

to Target.cs (not Build.cs) in intermediate/Source/ folder, according

https://forums.unrealengine.com/development-discussion/c-gameplay-programming/1699015-4-24-c-transition-guide?p=1699957#post1699957

and

http://www.aclockworkberry.com/a-script-to-fixup-includes-for-unreal-engine-4-24/

But, after I packaging, That Target.cs file returned to old status - The Line that I added into Target.cs is erased.

Check out this dude’s writeup on how to fix it - A script to fixup includes for Unreal Engine 4.24 | A Clockwork Berry

Once you add the

DefaultBuildSettings = BuildSettingsVersion.V2;

in the ProjectName.Target.cs file, you will get warnings when packaging. You need to go to the Project.Build.cs file and add an entry for each module you will use - e.g.

PublicDependencyModuleNames.AddRange(new string[] { 
			"Core", "CoreUObject", "Engine", "InputCore",
			"JSON", "JsonUtilities", "OnlineSubsystem",
			"SlateCore", "UMG" });

You’ll need to go to each header/cpp file that produces a warning and find its location. You then need to add the entire location to the #include = e.g.

#include <Json/Public/Dom/JsonValue.h>
#include <Core/Public/Templates/SharedPointer.h>
#include <Core/Public/Containers/Map.h>
#include <JsonUtilities/Public/JsonObjectConverter.h>

You will also have to fix any shadowing of local variables (meaning you declared a variable locally in a code block with the same name and type as a variable that is already in the class). Once these are fixed, everything will work normally. The linked article more or less uses an automated script to accomplish this.