Hot reload not working sometimes

Hello Unreal community. I made plugin (just few simple classes) and use it in my project. Everything works fine, but i can’t compile in Visual Studio when Editor is running. In VS i see error message:

Compiling game modules for hot reload
2>  Performing 4 actions (4 in parallel)
2>  [2/4] Link UE4Editor-MyPluginRuntime-5769.lib
2>     Creating library D:\Unreal\TestProject\Plugins\MyPluginRuntime\Intermediate\Build\Win64\UE4Editor\Development\UE4Editor-MyPluginRuntime-5769.lib and object D:\Unreal\TestProject\Plugins\MyPluginRuntime\Intermediate\Build\Win64\UE4Editor\Development\UE4Editor-MyPluginRuntime-5769.exp
2>  TestProjectGameMode.cpp
2>  [3/4] Link UE4Editor-TestProject-8983.dll
2>  [4/4] Link UE4Editor-TestProject-7949.lib
2>     Creating library D:\Unreal\TestProject\Intermediate\Build\Win64\UE4Editor\Development\UE4Editor-TestProject-8983.lib and object D:\Unreal\TestProject\Intermediate\Build\Win64\UE4Editor\Development\UE4Editor-TestProject-8983.exp
2>     Creating library D:\Unreal\TestProject\Intermediate\Build\Win64\UE4Editor\Development\UE4Editor-TestProject-8983.suppressed.lib and object D:\Unreal\TestProject\Intermediate\Build\Win64\UE4Editor\Development\UE4Editor-TestProject-8983.suppressed.exp
2>ERROR : UBT error : Failed to produce item: D:\Unreal\TestProject\Intermediate\Build\Win64\UE4Editor\Development\UE4Editor-TestProject-7949.lib

And in Editor:

LogModuleManager:Warning: ModuleManager: Unable to load module 'D:/Unreal/TestProject/Binaries/Win64/UE4Editor-TestProject-8983.dll' because the file couldn't be loaded by the OS.
Warning: HotReload failed, reload failed /Script/TestProject.

But if i’m compiling in Editor, no errors and hot reload is working as usual.

Maybe i’m doing something wrong? Please help me.

Hey -

Your post mentions you’re unable to compile in Visual Studio but then says you can compile in the editor with no errors. Just to make sure I understand correctly, you’re saying that when you compile in VS you get a message that hot reload did not complete, but you do not get this message if you compile in the project itself? If this is the case, this is a known “false positive” that VS is reporting, and the hot reload is actually completing successfully: Unreal Engine Issues and Bug Tracker (UE-42205) . If your issue is something different, please elaborate on your setup and reproduction steps to help me investigate the issue locally.

Cheers

Hi .
Yes, you are right, this is my case.
If you want, i can send sample project with this issue.
Thanks for your help!

Unfortunately Hotfix 4.15.1 doesn’t work for me. Yeah, false errors in VS now gone away, but hot reload still doesn’t work. I get the same warning in Editor:

LogModuleManager:Warning: ModuleManager: Unable to load module 'D:/Unreal/DbugVarsProject/Binaries/Win64/UE4Editor-DbugVarsProject-229.dll' because the file couldn't be loaded by the OS.
Warning: HotReload failed, reload failed /Script/DbugVarsProject.

In attachment link text you can find my test project. Repro steps:

1)Generate VS project files

2)Open project in VS

3)Compile and launch project

4)Change something in code (for example log in GameMode)

5)Build solution

6)Now you can see warning in editor without any errors and hot reload didn’t work

Hey -

I apologize for missing it before, but with the sample project you provided I now understand what is happening here. I didn’t understand that you are using a plugin and that is what is causing the problem. Plugin files are not included when a hot reload occurs, and the reason you’re getting the error you are is because your GameModeBase.cpp file references your plugin. So when the game hot reloads, that file searches for a compatible hot reload of the plugin which doesn’t exist.

Hey ,
So there is no way how to make this work? And there is only one solution: move all code from plugin to my project?

Also i can’t understand why when i compile in Editor everything works?

The editor compile completely ignores the plugin whereas VS fails when it tries to hot reload the plugin. You can also compile everything (game and plugin) by closing the editor and preforming a regular compile rather than a hot reload.

I also have this problem, using a couple of plugins that are referenced in my project c++ code.

Do I understand this correctly; It’s not possible to compile from VS and hot reload while having plugins referenced in project c++ code? I know I have been able to do this before but haven’t been able to since the hot reload .lib issue

You can compile, however changes to plugin code are not hot reloaded and won’t be reflected in the editor. The issue in this specific case is the project code contains a reference to a delegate that is defined in the plugin.

Thanks ,

So if I reference a delegate (e.g. an overlap event?) defined in my plugin code from my game code then even though I don’t change any plugin code the dll will not hot reload? Perhaps then that’s my problem too

edit: perhaps overlap event is special, let’s say another arbitrary event FComponentDoneDoingItsThing defined in a plugin if that makes a difference

I have the same issue.
Until it’s fixed, is there a way to disable hot reloading on new build in VS but still be able to hot reload when built in Editor? Then I could build in VS to fix compilation errors and do additional build in Editor when ready for testing.
Now a VS build forces restart of Editor.

Just bumping this a bit. We’re also having this issue with a plugin we’re referencing in C++. VS will compile hot reload versions of the plugin and our game. The editor fails to load the hot reload dll and the “compile” button in the toolbar disappears. It requires a recompile with the editor closed to restore everything. Using the editor “compile” button works fine but that doesn’t include functions/headers added after the editor was opened.

The weird part is that we’re not making any changes to the plugin code, just making references in our code. It seems to me like the two options here are 1)Figure out a way to make VS not recompile the plugin or 2)Make Unreal hot reload plugin files as well.

It doesn’t seem like Epic considers this behavior as a bug. It’s incredibly inconvenient to have to close the editor to recompile, so I’d love to know if there is a planned fix/workaround for this.

Hey -

If you are using a source version of the engine, you can open Windows->Developer Tools->Modules in the editor. The window that opens will show all available modules including your plugin and allow you to recompile the plugin.

Hey albus001-

This issue was fixed for 4.16.2. If you are still seeing this behavior, can you provide the setup you’re using and any details/steps that could help reproduce the behavior you’re seeing on my end?

I also have this problem, in version 4.16.2.
the issue is not resolved.

Hey -
My problem should be the same as .
The configuration of the project and the plug-in is default.

Steps:

  1. Open project in VS
  2. Compile
  3. Open editor
  4. Change the code for the project without changing the plug-in code
  5. Build solution
  6. Now you can see warning in editor without any errors and hot reload didn’t work

LogModuleManager:Warning:
ModuleManager: Unable to load module
‘D:/Unreal/DbugVarsProject/Binaries/Win64/UE4Editor-DbugVarsProject-229.dll’ because the file couldn’t be loaded by the OS.
Warning: HotReload failed, reload failed /Script/DbugVarsProject.

The issue of VS reporting a false positive of the compile failing was resolved for 4.16.2. For the issue of plugin code being able to be hot reloaded along with project code, a feature request (UE-25939) has been entered to allow this behavior. Please be aware that this issue may not be prioritized or fixed soon.

I understand hot reloading of a plugin can be considered a new feature, but hot reloading of the game code should work, regardless if plugin is enabled or not. Currently a plugin is breaking hot reload of the game.

I am dealing with the same issue, but rather than a plugin, it’s simply another game modue. The main module will hot reload fine, but not that second module.