Issue when trying to resolve a generic interface expecting an interface not concrete implementation - IInterface<IAnotherInterface>

As part of the example code for MediatR on GitHub there are a number of implementations for different IoC containers. The example sets up a number of Notification handlers which the mediator publ...

Id #12770 | Release: None | Updated: Dec 16 at 7:06 PM by randylevy | Created: Dec 16 at 3:53 PM by WestDiscGolf

Implement IServiceProvider

Please implement the System.IServiceProvider interface. It's a no-brainer and not a breaking change of any kind. Will help integrate the Dependency inversion principle into 3rd party applications...

Id #12769 | Release: None | Updated: Nov 1 at 3:59 PM by abatishchev | Created: Nov 1 at 7:15 AM by abatishchev

Exception retrieving registration for open generic type registration mapped to type with generic restriction

Reproducible with the following example: using System; using Microsoft.Practices.Unity; interface IBar { } interface IFoo<TBar> { } class Foo<TBar> : IFoo<TBar> where TBar : IBar { } class Pro...

Id #12768 | Release: None | Updated: Oct 29 at 7:30 PM by randylevy | Created: Oct 29 at 6:29 PM by OliverHallam

UnityExtensions references ServiceLocation, bindingRedirect doesn't help

After doing an update of all NuGet packages, one of my applications began crashing on start-up with a FileLoadException: Could not load file or assembly 'Microsoft.Practices.ServiceLocation, Versio...

Id #12767 | Release: None | Updated: Nov 11 at 7:03 PM by fcheung | Created: Oct 20 at 11:29 PM by CharlieHess

Reference required to assembly 'System.Runtime...'

This is a very odd error. It pops up sporadically, with no apparent cause. So here is what I did: I have a WPF application that targets .NET 4.5 I installed Unity from NuGet, and added a contain...

Id #12766 | Release: None | Updated: Oct 8 at 7:19 PM by cjrogala | Created: Oct 8 at 7:19 PM by cjrogala

Unity Container | Register Instance in XML Configuration

I need to register types in Unity.Config file and have this issue where remote object cannot be registered when done from the XML Configuration file. For e.g: This works var test=AccessorHelper....

Id #12765 | Release: None | Updated: Sep 22 at 3:49 AM by randylevy | Created: Sep 19 at 7:51 PM by RMK_P

Unity doesn’t work on real device in Xamarin.iOS (only in the simulator)

The Unity container doesn’t work on real device in Xamarin.iOS. It works fine only the simulator. I get following two errors, if I try to start my simple test project on iPhone (iOS 7.1): Error 1...

Id #12764 | Release: None | Updated: Aug 25 at 7:52 AM by MarianG | Created: Aug 23 at 9:01 AM by MarianG

parameterless public constructor

"An error occurred when trying to create a controller of type 'AirTimeController'. Make sure that the controller has a parameterless public constructor."

Id #12763 | Release: None | Updated: Aug 8 at 11:23 AM by dot_NET_Junkie | Created: Aug 6 at 7:47 PM by King007

Concurrency bug and memory leak in UnityServiceLocator

The constructor of the UnityServiceLocator class calls the container.RegisterInstance method to register itself and in doing that it creates both a concurrency bug and a memory leak, since the use...

Id #12762 | Release: None | Updated: Jul 21 at 2:01 PM by qujck | Created: Jul 21 at 10:35 AM by dot_NET_Junkie

Inconsistent Lazy<T> behaviour when resolving dependency

public class Bar {} public class Foo { public Foo(Bar b) { ; } } public class ChildBar : Bar {} unityContainer.RegisterInstance<Bar> ( new ChildBar() ); unityContainer.Resolve<Foo>(); // ret...

Id #12761 | Release: None | Updated: Jul 18 at 10:49 AM by clynamen | Created: Jul 18 at 10:35 AM by clynamen