Help compiling+linking BlankProgram with engine for asset tool

Hi everyone, hopefully someone here can help us out.

We’re trying to make a command line tool that uses the UE4 engine to manipulate certain aspects of uassets / umaps. We’ve gotten as far as being able to compile the BlankProgram project that comes with the github source, however we require the engine to be linked to use the following code without runtime serialization errors (because certain things are not compiled with WITH_EDITOR):

#include "BlankProgram.h"

#include "RequiredProgramMainCPPInclude.h"


IMPLEMENT_APPLICATION(BlankProgram, "BlankProgram");

	GEngineLoop.PreInit(ArgC, ArgV);

	UPackage* levelPackage = Cast<UPackage>(LoadPackage(NULL, TEXT("AssetName"), 0));

	return 0;

We’ve been playing around with the following in BlankProgram.Target.cs

        UEBuildConfiguration.bBuildEditor = false;
        UEBuildConfiguration.bCompileAgainstEngine = true;
        UEBuildConfiguration.bCompileAgainstCoreUObject = true;
        OutLinkEnvironmentConfiguration.bIsBuildingConsoleApplication = true;
        OutLinkEnvironmentConfiguration.bHasExports = false;

…and adding what we think we need in BlankProgram.Build.cs, but sadly to no avail. Can anyone provide the exact code we need in BlankProgram.Build.cs and BlankProgram.Target.cs to compile and run successfully?

Thanks in advance!