title: How to test all ASP.NET Core Controllers Dependency Injection is valid?
body: <p>We occasionally have issues whereby someone adds some DI into a controller but forgets to add the relevant line into Startup.cs to set the scope of the object.</p>
  
  <p>This does not prevent the application from starting, but rather, throws an exception when the relevent endpoint is hit.</p>
  
  <p>Is there any way of programmatically checking all controllers are valid and preventing the application from starting otherwise?</p>
  
  <p>Alternatively is there an easy way to write a catch-all automated test to check every controller can be instantiated using the specified DI in Startup.cs?</p>