Is it useful to call Verify for discussion. Back in 2011, Mark Seemann thought such a method was nearly useless . My opinion is that there is real value in calling Verify , but I understand Mark's opinion and agree that calling Verify alone is usually insufficient. That's why there is a clear guide to Verifying Container Configurations in the Simple Injector wiki that you save your DI configuration.
However, with Simple Injector, Verify does much more than testing if it can create graphic objects. The Verify call launches a simple Diagnostic Services injector that looks for very common, but sometimes very difficult to detect configuration errors (a which was not available at the time Mark wrote this article).
In general, my advice is to call container.Verify in your production code for as long as possible. Always call it at startup, both in debugging and release builds, in your intermediate environment and during production.
As the application grows larger, launching a container.Verify call at startup becomes more time consuming. Some types of applications are more sensitive to this than others. For server-side applications, it is usually normal to have longer startup times, while desktop and mobile phone applications should start faster.
Once you get into a position where the Verify call takes too much time, but only then - you should delete the Verify call, but at least still have a unit / integration test that calls container.Verify , I don't see a packaging problem Verify in the compiler directives (as in your question), but note again that IMO should delay deleting the call until Verify on your way to start as long as possible.
source share