After performing a clean install of UE5, I can create and launch projects without any issues. However as soon I try building a project in Visual Studio 2022, it gives me following error:
“Unhandled exception: System.IO.FileNotFoundException: Could not find file ‘D:\Unreal Engine\UE_5.0\Engine\Binaries\Win64\UnrealHeaderTool.target’.”
The weird thing is that the missing files are present upon clean install, and vanish before my eyes from the folder as soon I try building in VS, resulting in error and corruption of the engine install so I can no longer launch or create projects, forcing me to re-install or verify the engine.
I had this issue today as well. For me, it was installing the Substance plugin from the launcher. Interestingly, adding the plugin manually to a project instead of the engine doesn’t cause any issues for me. I have also seen a similar post where someone had issues with the Discord plugin.
The “UnrealHeaderTool.target” file have so far been removed twice for me…
I also seems to lose some folders and files in "UE_5.0\Engine\Intermediate".
Like in “UE_5.0\Engine\Intermediate\Build\Win64\UnrealEditor\Inc” I have multiple times lost the first 69 folders, Engine is the first folder.
It seems to happen sometime when I use Rebuild “Project”.
Thanks all for the suggestions! Looking further into it, it seems that the problem isn’t limited to UnrealHeaderTool, the engine binaries Win64 folder is 18GB before running build and 2GB after, and the plugins folder went from 53GB to 21GB, so building any project in Visual Studio nukes many of files in there.
Moving Substance plugin to the project folder instead of engine’s did not help, neither did denying SYSTEM delete permissions or adding them to firewall exception, files still got deleted.
However, I just realised that I’ve been running “rebuild solution” in VS instead of “build ProjectName”, which is what was nuking the engine as I guess it attempted to rebuild it and failed? Running “build ProjectName” instead solved the issue.
Although it’s weird, since I was using “rebuild solution” before in Unreal 4 without issues.
Happy/sad to see it’s not just a problem on my end. I was just trying to troubleshoot an unrelated issue where the launcher no longer sees my network drive (vault cache location)… I really didn’t need this piling on.
I have the same issue with UE5 and Visual Studio 2022. I had to reinstall entire engine twice, repaired it twice and the problem persists. Also some of the UE5 plugins from the Market Place will not install, even if they are compatible with UE5.
After the unsuccessful Build (not rebuild) Unreal Engine will no longer start, it shows the following error message:
Same to me, asking continously to repair.
VS 19 and VS 22 + UE5.0
Formatted PC didn’t fix, now it’s presenting again on fresh installation.
In addition I cannot compile directly “UnrealHeaderTool” error via VS 19 and VS22, if I try on desktop command the error is: " Engine Modules are out of date, and cannot be compiled while the engine is running. Please rebuild through your IDE "