Reset ObjectFactory in StructureMap
问题 I'm writing some unit tests that rely on StructureMap so I want to completely reset the ObjectFactory in my [SetUp] method. This is what my [SetUp] method looks like right now: [SetUp] public void SetUp() { ObjectFactory.Initialize(initializationExpression => {}); } This appears to reset the configuration because I can execute the ObjectFactory.WhatDoIHave() method and it does not contain any of my configuration. However, cached instances of objects are not removed and are returned in