Если вы видите код Сброс - это то, что вы ищете, он удалит все регистрации и предыдущие экземпляры, т.е. очистит все поиски, которые есть у Io C.
SimpleIoc.Default.Reset();
Ваш код не работает, потому что он очищает только экземпляр кэша регистрации, как вы можете видеть здесь в коде.
/// <summary>
/// Removes the given instance from the cache. The class itself remains
/// registered and can be used to create other instances.
/// </summary>
/// <typeparam name="TClass">The type of the instance to be removed.</typeparam>
/// <param name="instance">The instance that must be removed.</param>
public void Unregister<TClass>(TClass instance)
where TClass : class
Если вы хотите сделать этот один тип по одному вам придется использовать:
/// <summary>
/// Unregisters a class from the cache and removes all the previously
/// created instances.
/// </summary>
/// <typeparam name="TClass">The class that must be removed.</typeparam>
[SuppressMessage(
"Microsoft.Design",
"CA1004",
Justification = "This syntax is better than the alternatives.")]
public void Unregister<TClass>()
where TClass : class
HIH