simpleinjector / SimpleInjector

An easy, flexible, and fast Dependency Injection library that promotes best practice to steer developers towards the pit of success.
https://simpleinjector.org
MIT License
1.21k stars 154 forks source link

Use Type.SatisfiesConstraints internally #962

Open dotnetjunkie opened 1 year ago

dotnetjunkie commented 1 year ago

See: https://github.com/dotnet/runtime/issues/28033

Possibly added to .NET 7 a future .NET version, the SatisfiesConstraints check allows Simple Injector to do a reliable test instead of catching the exception thrown by MakeGenericType, which prevents unwanted first chance exceptions.

Downside of implementing this is that a new build output is added to the Simple Injector package.