This project is read-only.


Prevent warning about 'disposable transient' in Web API and MVC controller registrations


The 2.7 release of Simple Injector added a new diagnostic warning named Disposable Transient Components. Unfortunately, this warning causes false-positives in case users use the RegisterWebApiControllers or RegisterMvcControllers extension methods. Technically the warning is correct, since those controllers are registered as transient, but both frameworks ensure that controllers are disposed when the request ends.

Therefore, those methods must be able to suppress the warnings on those registrations.

This issue was initially reported here.
Closed Apr 10, 2015 at 3:55 PM by dot_NET_Junkie


dot_NET_Junkie wrote Mar 3, 2015 at 12:01 PM

This issue can be fixed after 21008 has been implemented. When Diagnostics is part of the core library, we will be able to do something as follows:
Registration r = [some registration]

dot_NET_Junkie wrote Mar 11, 2015 at 8:43 PM

Fixed in changeset bc2935912d4552fcb230aebf107949a25851d52a