Torbjörn Hansson

Results 3 comments of Torbjörn Hansson

This is used for a web socket middleware. It's basically a modified clone of https://radu-matei.com/blog/aspnet-core-websockets-middleware/ Used to have the service provider in the ctor but after upgrade to .NET Core...

I tested with TryGetInstance as you suggested and it indeed returns null. GetInstance returns correct service. After calling GetInstance it works with TryGetInstance, so this seems to be a StructureMap...

This seems to be by design in StructureMap, if something isn't registered in the container. http://structuremap.github.io/resolving/try-getting-an-optional-service-by-plugin-type/