Problem with packaging of MSVC (C4668, C4067, C4996)

Continuing the discussion from Can't compile 5.4 Projects anymore, I need help.:

For those who are looking for an answer!

The solutions above were partially correct:

  1. Open file in your project (ProjectFolder → Source → project.target.cs)
    and change (DefaultBuildSettings = BuildSettingsVersion.V2) to (DefaultBuildSettings = BuildSettingsVersion.Latest;)

  2. Open file in folder (AppData\Roaming\Unreal Engine\UnrealBuildTool) and change code with new version:

Code:

<?xml version="1.0" encoding="utf-8" ?>
<Configuration xmlns="https://www.unrealengine.com/BuildConfiguration">
    <WindowsPlatform>
        <CompilerVersion>14.38.33130</CompilerVersion>
    </WindowsPlatform>
</Configuration>

Important, when I first changed the file to new version, I got an error that there was no such version (MSVC).

But (Unreal Engine) also wrote what version is present in (Visual studio), so I just changed the version in code to the one that was already on the computer.

Done!