5/19/2023 0 Comments Prism 8.0Var container = ContainerLocator.Container Public override IServiceProvider CreateServiceProvider(IServiceCollection services)ĬontainerLocator.SetContainerExtension(CreateContainerExtension) Private IContainerExtension CreateContainerExtension() => Private void RegisterTypes(IContainerRegistry container) In a ShinyStartup you might have something like: public class MyStartup : ShinyStartup This ensures container is disposed and that the container instance is cleared along with the delegate to create a new instance. While not entirely an uncommon issue, while unit testing it is commonly recommended that you reset the ContainerLocator. In the event that you need to access the raw IContainerExtension you can do so by accessing ContainerLocator.Current. Use these at your own risk, and only under the right circumstances. These API's are intentionally hidden from intellisense because they are not for common consumption. Please note that the information here is for advanced users only. If you do not call ContainerLocator.Current or ContainerLocator.Container after setting the creation delegate, subsequent calls to SetContainerExtension will override your initial delegate.
0 Comments
Leave a Reply. |