Is there TryResolve in Unity?
How can I make Unity not to throw ResolutionFailedException if Resolve fails? Is there something like TryResolve<IMyInterface> ? var container = new UnityContainer(); var foo = container.TryResolve<IFoo>(); Assert.IsNull(foo); Johan Leino This has been an issue on the codeplex site, you can find the code here (look at the bottom of that thread and they have made an extension method...very handy) http://unity.codeplex.com/Thread/View.aspx?ThreadId=24543 and the you can use code like this: if (container.CanResolve<T>() == true) { try { return container.Resolve<T>(); } catch (Exception e) { // do