# \[4.17.2\] FindImportClassAndPackage & Linker-\>Preload don't work properly in packaged game,but editor

**URL:** <https://forums.unrealengine.com/t/4-17-2-findimportclassandpackage-linker-preload-dont-work-properly-in-packaged-game-but-editor/102018>\
**Category:** C++\
**Tags:** unreal-engine\
**Created:** [October 31, 2017, 2:51pm UTC](https://forums.unrealengine.com/t/4-17-2-findimportclassandpackage-linker-preload-dont-work-properly-in-packaged-game-but-editor/102018 "2017-10-31T14:51:48Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Memnarch](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Memnarch](https://forums.unrealengine.com/u/Memnarch)\
**Post date:** [October 31, 2017, 2:51pm UTC](https://forums.unrealengine.com/t/4-17-2-findimportclassandpackage-linker-preload-dont-work-properly-in-packaged-game-but-editor/102018/1 "2017-10-31T14:51:48Z")

</div>

To create a maplist, i decided to build the same system Epic uses for UnrealTournament. Extending WorldSettings with a new property-object which holds summary information and at runtime, extract/load that specific summary object from a map. However, i noticed things are quite different in packaged games.  
Here is the code from UT (since i can’t share project source atm):  
[https://github.com/EpicGames/UnrealTournament/blob/f96172e8177ba990110efd26a7438b9bfa415bae/UnrealTournament/Source/UnrealTournament/Private/UTGameEngine.cpp#L962](https://github.com/EpicGames/UnrealTournament/blob/f96172e8177ba990110efd26a7438b9bfa415bae/UnrealTournament/Source/UnrealTournament/Private/UTGameEngine.cpp#L962)

The asset specific stuff had to be changed since AssetRegistry is a bit different in 4.17.2 compared to the version UT uses. But from the part on after it, its the same. Right now, i have 2 of our maps loaded in editor and set summary info. This means these 2 maps use the new worldsettings and summary-object. Several other maps don’t(yet). From PIE (or Standalone from editor) Linker-\>FindImportClassAndPackage reports true on the 2 maps i have modified and false on the other maps not using the new stuff. That seems right. The rest of the code then runs like a charm. In a packaged build, this goes bonkers. Linker-\>FindImportClassAndPackage always reports true and Linker-\>Preload will always fail with an assertion. Even on those 2 maps i modified. The assertion is:  
Assertion failed: InPos \>= 0 && InPos \<= TotalSizeOrMaxInt64IfNotReady() [File:D:\Build++UE4+Release-4.17+Compile\Sync\Engine\Source\Runtime\CoreUObject\Private\Serialization\AsyncLoading.cpp] [Line: 7183]

However i see no reason why this check fails only in packaged builds 😕

---

<div class="post-metadata">

**Author:** ![kamrann](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@kamrann](https://forums.unrealengine.com/u/kamrann)\
**Post date:** [November 1, 2017, 2:31am UTC](https://forums.unrealengine.com/t/4-17-2-findimportclassandpackage-linker-preload-dont-work-properly-in-packaged-game-but-editor/102018/2 "2017-11-01T02:31:32Z")

</div>

So I’m guessing you have also duplicated the related code, in particular that relating to the level summary in UTWorldSettings.cpp? If so, when you package, the cooker will be loading these maps into memory, which will trigger the summary creation, and then serializing them, cooked. So to me, it makes sense that all your maps will be behaving the same in the cooked build.

Afraid I can’t help with the crash. It looks like some kind of serialization mismatch, where what got written to disk isn’t what the code doing the deserializing is expecting. Hard to say more than that.

---

<div class="post-metadata">

**Author:** ![Memnarch](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Memnarch](https://forums.unrealengine.com/u/Memnarch)\
**Post date:** [November 1, 2017, 4:36pm UTC](https://forums.unrealengine.com/t/4-17-2-findimportclassandpackage-linker-preload-dont-work-properly-in-packaged-game-but-editor/102018/3 "2017-11-01T16:36:49Z")

</div>

Yes, my Worldsetting was extended accordingly. Thanks for the information on what the cooker does. But ultimately i haven’t found a solution 😕

---

<div class="post-metadata">

**Author:** ![Memnarch](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Memnarch](https://forums.unrealengine.com/u/Memnarch)\
**Post date:** [November 7, 2017, 5:46pm UTC](https://forums.unrealengine.com/t/4-17-2-findimportclassandpackage-linker-preload-dont-work-properly-in-packaged-game-but-editor/102018/4 "2017-11-07T17:46:11Z")

</div>

I have created an answerhub-post in addition. In case anybody has any help/hint/info/whatever:

> **[UT like LevelSummary, FLinker::Preload fails](https://forums.unrealengine.com/questions/723144/ut-like-levelsummary-flinkerpreload-fails.html)**
>
> Hi, For our project i wrote a Levelsummary system like the one implemented for UnrealTournament. As i can’t share my code right now, i will point to the parts in the UT code(since all i had to change was how to get the assets from the AssetRegistry,...
