UE5: Trying to build project in VS nukes "UnrealHeaderTool" and then complains about it missing, corrupting the engine install

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.

2 Likes