1

Closed

container.GetInstance<object>() always succeeds

description

The following code is expected to fail, since System.Object is not registered:
 
var container = new Container();
 
// This call should fail.
container.GetInstance<object>();
 
However, since object is concrete type with a single public constructor, it will be generated automatically by the container.
 
There should be an exception when the unregistered concrete type is an System.Object, since users would not expect this, and it makes no sense to let the container create transient System.Object instances.
Closed Jul 12, 2012 at 7:58 PM by dot_NET_Junkie

comments

wrote Jul 12, 2012 at 7:58 PM

Resolved with changeset 92738.