WHY this Fails while Building UE5.2?

Seems like there is some directx library missing.

1>------ Build started: Project: MemoryProfiler2, Configuration: Release Any CPU ------
1>MemoryProfiler2 -> E:\UnrealEngine-5.2-preview-1\Engine\Source\Programs\MemoryProfiler2\bin\Release\net6.0-windows\MemoryProfiler2.dll
2>------ Build started: Project: UE5ProgramRules, Configuration: Release Any CPU ------
2>E:\UnrealEngine-5.2-preview-1\Engine\Source\Programs\ShaderCompileWorker\ShaderCompileWorker.Build.cs(34,28,34,35): error CS0103: The name 'DirectX' does not exist in the current context
2>E:\UnrealEngine-5.2-preview-1\Engine\Source\Programs\Shared\EpicGames.Perforce.Native\DotNetPerforceLib.Build.cs(5,14,5,31): warning CA1050: Declare types in namespaces
2>E:\UnrealEngine-5.2-preview-1\Engine\Source\Programs\Shared\EpicGames.Perforce.Native\DotNetPerforceLib.Target.cs(5,14,5,37): warning CA1050: Declare types in namespaces
2>E:\UnrealEngine-5.2-preview-1\Engine\Source\Programs\Enterprise\Datasmith\DatasmithRhinoExporter\DatasmithRhino7.Target.cs(20,11,20,118): warning CA1416: This call site is reachable on all platforms. 'Registry.GetValue(string, string?, object?)' is only supported on: 'windows'.
2>E:\UnrealEngine-5.2-preview-1\Engine\Source\Programs\Enterprise\Datasmith\DatasmithSolidworksExporter\DatasmithSolidworks2021.Target.cs(25,21,25,45): warning CA1416: This call site is reachable on all platforms. 'RegistryKey.GetValueNames()' is only supported on: 'windows'.
2>E:\UnrealEngine-5.2-preview-1\Engine\Source\Programs\Enterprise\Datasmith\DatasmithSolidworksExporter\DatasmithSolidworks2021.Target.cs(22,26,22,104): warning CA1416: This call site is reachable on all platforms. 'RegistryKey.OpenSubKey(string)' is only supported on: 'windows'.
2>E:\UnrealEngine-5.2-preview-1\Engine\Source\Programs\Enterprise\Datasmith\DatasmithSolidworksExporter\DatasmithSolidworks2021.Target.cs(31,14,31,52): warning CA1416: This call site is reachable on all platforms. 'RegistryKey.GetValue(string?)' is only supported on: 'windows'.
2>E:\UnrealEngine-5.2-preview-1\Engine\Source\Programs\Enterprise\Datasmith\DatasmithSolidworksExporter\DatasmithSolidworks2021.Target.cs(22,26,22,47): warning CA1416: This call site is reachable on all platforms. 'Registry.LocalMachine' is only supported on: 'windows'.
2>E:\UnrealEngine-5.2-preview-1\Engine\Source\Programs\Enterprise\Datasmith\DatasmithRhinoExporter\DatasmithRhino6.Target.cs(166,11,166,118): warning CA1416: This call site is reachable on all platforms. 'Registry.GetValue(string, string?, object?)' is only supported on: 'windows'.
2>Done building project "UE5ProgramRules.csproj" -- FAILED.
1 Like

Did you get an answer for this, or is it still outstanding? It looks like a problem with an assembly in C#, not finding the assembly that has the DirectX in it. I’m no expert on it, and I’m running into the same problem compiling 5.2 to make a direct server now that 5.2 has been released.

I found a video with all the specifics needs to build 5.2 in VS 2022. There are some things that I didn’t know at the time.

1 Like

Hey Gabriel, could you describe the fix you used to solve this problem or link the video?
I came across this issue too and your post seems to be one of the few posts on the matter.

This will fix it:

" For the DirectX error we used the hotfix reverting Engine\Source\Programs\ShaderCompileWorker\ShaderCompilerWorker.Build.cs . Otherwise replace line 34 with
RuntimeDependencies.Add(Path.Combine(Target.RelativeEnginePath, "Binaries/ThirdParty/Windows/DirectX/x64/d3dcompiler_47.dll"));"

6 Likes

This is the solution to the problem!!! Thank you @IMGGustav

Thank you very much!!!