Debugging StructureMap with WhatDoIHave()

Having issues with StructureMap? Getting the exception

No default instance defined

Try running 

Debug.WriteLine(container.WhatDoIHave());

and let StructureMap tell you what it knows. This method returns a formatted string showing everything in your container. If you see a blank in the configured instances then that’s something that is registered but doesn’t have a concrete instance.

 

Leave a Reply

Your email address will not be published. Required fields are marked *