UnrealHeaderTool running every time I save in Visual Studio 2022

This doesn’t appear to be a problem that anyone has ever had but me. But for some reason when I save a cpp file in VIsual Studio, every single save no matter how small, triggers that UnrealHeaderTool to run. And it takes like 10 seconds. And it locks my files from being saved again. And I’m worried at some point its just gonna lead to a failed unlock, or corruption or something. please halp.

I’ve got hot reload turned off, not that it matters cause the editor is closed anyway. I don’t have any weird extensions. I can’t find anything that would do it in VS options. I’m out of ideas.

Running UnrealHeaderTool for "C:\SOURCE\ACTIONROGUELIKE\SOURCE\ACTIONROGUELIKE\PUBLIC\ARLACTIONCOMPONENT.H"
Command: cmd.exe /C ""C:\Epic Games\UE_5.1\Engine\Build\BatchFiles\Build.bat" ActionRoguelikeEditor Win64 Development -Project="C:\source\ActionRoguelike\ActionRoguelike.uproject" -WaitMutex -FromMsBuild -singlefile="C:\SOURCE\ACTIONROGUELIKE\SOURCE\ACTIONROGUELIKE\PUBLIC\ARLACTIONCOMPONENT.H" -nooutput"

Every. single. save. (sigh)

3 Likes

Fixed.

The solution is to go to your VS installer, find w/e version you’re running, and uninstall IDE support.

A note to UE dev team, please disable rebuild on save lol. Noone in their right mind wants that, and it makes that IDE support package or w/e completely unusable. I have to wait like 10 seconds between every save. I can’t hard recommend deleting that option enough until that’s fixed lol.

1 Like

At long last i found someone with the same problem as me. Thank you very much for the solution. For me it opened a save-as dialogue everytime i tried to save a file since the UHT was still running in the background. Very frustrating behavior!

I’m getting the same issue after updating to the latest version of Visual Studio.

The current behavior (automatically running the HeaderTool, temporarily locking your source file after editing/saving which makes you temporarily unable to save/compile) is not good, and I hope that the parties responsible disable this behavior by default in the next update. I’m constantly getting Save-As popups when I try to Ctrl-S save source files (which I do quite frequently), and this is quite irritating while coding.

Disabling the IDE support via the VS installer resolves the HeaderTool issue, but now I seem to be getting a ton of IntelliSense errors everywhere, so it might not be a perfect solution.

I wonder if there’s a config file somewhere that we can modify to disable just the automatic HeaderTool behavior…

Edit: It looks like there is indeed a setting, and disabling it seems to fix the issue, so there is no need to uninstall IDE support! Thanks, below poster.

VS you can go to: Tool->Options->Unreal Engine->General->CodeAnalysis and change “Enable Code Analysis with Unreal Header Tool” to false

7 Likes

If you don’t want to completely uninstall IDE support, in VS you can go to: Tool->Options->Unreal Engine->General->CodeAnalysis and change “Enable Code Analysis with Unreal Header Tool” to false. This way you can still keep the enhanced BP support, Macro Intellisense support, etc.

9 Likes

Finally found the solution! Thank you!