Closed Tobriand closed 5 years ago
Hey,
Thanks for reporting this issue, I see where the problem is, I'll fix it soon and put into the next version!
Published a new version with the fix to my pre-release nuget feed, could you please check that it works as expected? Thanks!
That was fast! Thanks for the fix - looks like it's behaving on the PreRelease version :)
First, new to DI and StashBox, so thanks (generally) and hope this is actually an issue, and not me misunderstanding how this is supposed to work.
When a type has been registered into a container using
c.Register<IFoo>(typeof(Foo), x => x.WithFactory(s => new Foo()));
and resolve is called against Foo, if Foo has any properties that are identified for injection, the attempt is instead made to inject them againstIFoo
rather than againstFoo
.In particular, the below works (in the C# interactive pane in VS):
Whereas this version doesn't:
Instead it throws the following:
This is the same exception thrown if you attempt the following, so it's probably what's happening: