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.22k stars 152 forks source link

Use Type.SatisfiesConstraints internally #962

Open dotnetjunkie opened 2 years ago

dotnetjunkie commented 2 years 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.