Unable to build 'System.Drawing.Common' 4.7.0 has a know critical severity vulnerability. Please Help

Update .NET

Error NU1904 Warning As Error: Package ‘System.Drawing.Common’ 4.7.0 has a known critical severity vulnerability, .NET Core Remote Code Execution Vulnerability · CVE-2021-24112 · GitHub Advisory Database · GitHub [C:\Program Files\UE_5.1\Engine\Source\Programs\AutomationTool\Scripts\AutomationScripts.Automation.csproj]
Infested C:\Program Files\UE_5.1\Engine\Source\Programs\AutomationTool\AutomationUtils\AutomationUtils.Automation.csproj 1

Error NU1904 Warning As Error: Package ‘System.Drawing.Common’ 4.7.0 has a known critical severity vulnerability, .NET Core Remote Code Execution Vulnerability · CVE-2021-24112 · GitHub Advisory Database · GitHub Infested C:\Program Files\UE_5.1\Engine\Source\Programs\AutomationTool\Scripts\AutomationScripts.Automation.csproj 1
Error NU1904 Warning As Error: Package ‘System.Drawing.Common’ 4.7.0 has a known critical severity vulnerability, .NET Core Remote Code Execution Vulnerability · CVE-2021-24112 · GitHub Advisory Database · GitHub Infested C:\Program Files\UE_5.1\Engine\Source\Programs\AutomationTool\Scripts\AutomationScripts.Automation.csproj 1
Error MSB3073 The command ““C:\Program Files\UE_5.1\Engine\Build\BatchFiles\Build.bat” InfestedEditor Win64 Development -Project=“C:\Infested\Infested.uproject” -WaitMutex -FromMsBuild” exited with code 6. Infested C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.MakeFile.Targets 44

This is because the new versions of visual studio now include this as a warning and Unreal has warnings as errors so now its an error and won’t work.

You have a few choices:

Downgrade to an earlier version of visual studio
I believe it changed in 17.8 so an earlier version will bypass this.

Change the .csproj files so that it references a different version of the package (I believe there are 3 of them in UE5.2, not sure for 5.1) . 4.7.2 allegedly works.
That means taking:

and changing it to:

Change the .csproj files to ignore ALL of these nuget warnings.
That means adding:
false
to the section at the top of EACH of those csproj files

Change the project references to ignore the warning for that specific include
That means replacing:

with
<PackageReference Include=“System.Drawing.Common” Version=“4.7.0” NoWarn=“NU1901”/>

Any of those will get you back on board. I’ve applied the 3 one to my projects.