What?
Calling the Get-It Service Locator unregister method within the main dispose method causes an exception when closing the application.
Why?
According to the Get-It package documentation the unregister method is used to unregister an [instance] of an object or a factory/singleton by Type [T] or by name [instanceName]. Not supplying an Type [T] or name causes the exception.
The reset
method should be used to fully dispose the Service Locator. The reset
method is asynchronous and cannot be used in the dispose method.
How?
Call the reset
method of the Get-It Service Locator in the asynchronous onWindowClose
method.