InitializeModules can throw an ArgumentException

When Assembly.GetEntryAssembly() returns null, prefix remains an empty string and Path.GetDirectoryName(prefix) ends up throwing an ArgumentException.