Legacy C# loader, that we need to convert into upgrade.cpp into the current sources