Sometimes you need to initialize outside of the scope of a PerigeeApplication. We do this for API applications, blazor applications, and other scenarios where we need to call something before Perigee.
static void Main(string[] args) {
//To initialize perigee and the thread system:
ThreadRegistry tr = ThreadRegistry.InstanceWithArgs(args);
//Initializing credentials is not usually required unless changing working directories.
//If you must initialize them, use either A or B:
//A) Call instance
var cinstance = CredentialStore.Instance;
//B) Congiure
CredentialStore.Configure()
}
Host Statistics
To get information about the host it's running on, there is a single method:
GetHostStatistics()
The response class, HostStatistics contains properties for the machine it's running on including machine name, drive info, cpu time and running directory.
Exit event
To get an exit callback, use the helper method supplied.
After return is executed and the domain/service is about to unload, OnExit has a few seconds to perform any last tasks, like persisting data.