UE4 Crashes when Building in VS

When building the solution in Visual Studio UE4.9 is crashing. To be clear this is in regards to hot reloading after building in Visual Studio while your project is open in UE.

MachineId:F7FC842<removed>
EpicAccountId:<removed>

Unknown exception - code 00000001 (first/second chance not available)

"Fatal error: [File:D:\BuildFarm\buildmachine_++depot+UE4-Releases+4.9\Engine\Source\Runtime\CoreUObject\Private\UObject\UObjectGlobals.cpp] [Line: 2710] 
FObjectFinders can't be used outside of constructors to f

UE4Editor_Core!FDebug::AssertFailed() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.9\engine\source\runtime\core\private\misc\outputdevice.cpp:354]
UE4Editor_CoreUObject!ConstructorHelpers::CheckIfIsInConstructor() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.9\engine\source\runtime\coreuobject\private\uobject\uobjectglobals.cpp:2711]
UE4Editor_Squad_3646_Win64_DebugGame!ConstructorHelpers::FObjectFinder<UCurveFloat>::FObjectFinder<UCurveFloat>() [c:\program files\epic games\4.9\engine\source\runtime\coreuobject\public\uobject\constructorhelpers.h:96]
UE4Editor_Squad_3646_Win64_DebugGame!FWeaponData::FWeaponData() [d:\perforce\squad\source\squad\classes\weapon\squadweapon.h:166]
UE4Editor_Squad_3646_Win64_DebugGame!ASquadWeapon::ASquadWeapon() [d:\perforce\squad\intermediate\build\win64\ue4editor\inc\squad\squad.generated.cpp:11963]
UE4Editor_Squad_3646_Win64_DebugGame!ASquadWeapon::__VTableCtorCaller() [d:\perforce\squad\source\squad\classes\weapon\squadweapon.h:174]
UE4Editor_Squad_3646_Win64_DebugGame!InternalVTableHelperCtorCaller<ASquadWeapon>() [c:\program files\epic games\4.9\engine\source\runtime\coreuobject\public\uobject\class.h:2368]
UE4Editor_CoreUObject!UClass::HotReloadPrivateStaticClass() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.9\engine\source\runtime\coreuobject\private\uobject\class.cpp:3845]
UE4Editor_Squad_3646_Win64_DebugGame!GetPrivateStaticClassBody<ASquadWeapon>() [c:\program files\epic games\4.9\engine\source\runtime\coreuobject\public\uobject\class.h:2413]
UE4Editor_Squad_3646_Win64_DebugGame!ASquadWeapon::GetPrivateStaticClass() [d:\perforce\squad\intermediate\build\win64\ue4editor\inc\squad\squad.generated.cpp:1242]
UE4Editor_Squad_3646_Win64_DebugGame!TClassCompiledInDefer<ASquadWeapon>::Register() [c:\program files\epic games\4.9\engine\source\runtime\coreuobject\public\uobject\uobjectbase.h:323]
UE4Editor_CoreUObject!UClassRegisterAllCompiledInClasses() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.9\engine\source\runtime\coreuobject\private\uobject\uobjectbase.cpp:649]
UE4Editor_CoreUObject!ProcessNewlyLoadedUObjects() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.9\engine\source\runtime\coreuobject\private\uobject\uobjectbase.cpp:815]
UE4Editor_CoreUObject!TBaseStaticDelegateInstance<void __cdecl(void)>::ExecuteIfSafe() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.9\engine\source\runtime\core\public\delegates\delegateinstancesimpl_variadics.inl:921]
UE4Editor_Core!TBaseMulticastDelegate<void>::Broadcast() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.9\engine\source\runtime\core\public\delegates\delegatesignatureimpl_variadics.inl:809]
UE4Editor_Core!FModuleManager::LoadModuleWithFailureReason() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.9\engine\source\runtime\core\private\modules\modulemanager.cpp:426]
UE4Editor_Core!FModuleManager::LoadModule() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.9\engine\source\runtime\core\private\modules\modulemanager.cpp:298]
UE4Editor_HotReload!FHotReloadModule::DoHotReloadInternal() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.9\engine\source\developer\hotreload\private\hotreload.cpp:702]
UE4Editor_HotReload!FHotReloadModule::DoHotReloadFromIDE() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.9\engine\source\developer\hotreload\private\hotreload.cpp:1201]
UE4Editor_HotReload!FHotReloadModule::Tick() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.9\engine\source\developer\hotreload\private\hotreload.cpp:1137]
UE4Editor_Core!FTicker::Tick() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.9\engine\source\runtime\core\private\containers\ticker.cpp:79]
UE4Editor!FEngineLoop::Tick() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.9\engine\source\runtime\launch\private\launchengineloop.cpp:2547]
UE4Editor!GuardedMain() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.9\engine\source\runtime\launch\private\launch.cpp:142]
UE4Editor!GuardedMainWrapper() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.9\engine\source\runtime\launch\private\windows\launchwindows.cpp:126]
UE4Editor!WinMain() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.9\engine\source\runtime\launch\private\windows\launchwindows.cpp:200]

Hey Pewbot-

Looking at the log file it appears you’re trying to use FObjectFinder outside of a constructor somewhere. If this occurred after editing code you may want to check the source files that you were working on before compiling.

Cheers

no this is because VS is replacing the build dll’s and UE crashes because the .dll is being replaced. It is respective to hot reload.

Could you post the log file in the project’s Saved/Logs folder to provide additional information? Also, could you post the project that is getting the crash?