ninject/ninject — Issue #43: NPE binding an instance with a property
Author: alecthomas
Created: 2012-01-20 06:07:22+00:00
State: open

I am using [the current Mono download](https://github.com/downloads/ninject/ninject/Ninject-2.2.1.0-release-mono-2.0-no-web.zip) and the following test case fails with a null pointer exception.

The same test works with the previous version of Ninject, 2.2.0.0.

```cs
interface ITestInterface
{
string Property { get; set; }
}

class TestImpl : ITestInterface
{
public string Property {
get { return "Foo";}
set { }
}
}

[TestFixture()]
public class ModelModuleTest
{

[Test()]
public void TestInterfaceBinding ()
{
IKernel kernel = new StandardKernel ();
kernel.Bind ().To ();
Assert.IsNotNull (kernel.Get ());
}
}
```
Same error occurs when binding ToConstant (new TestImpl ()).

Unfortunately I don't know how to copy the stack trace from MonoDevelop :(