This project is read-only.

ResolveConstructor Exception


Greetings Rishi
I am getting an exception trying to use the Repository pattern and your Resource Locator Framework. The solution is split into 3 projects the UI app, Model (contains teh POCO objects), and the Repository which contains the various interfaces and their implementations (split into relating folders within the repository project).
when i try an use the dependancy injection of the resolve constructor attribute and this
public Constructor(IRepository repository)
It throws an exception as it cannot resolve the type - is this an issue with the fact that the view model and the resource that i wish to resolves interface and implementation are not in the same project?
Please get back to me as i wish to be able to di this and treat my Repositories as singletons.


Orktane wrote Feb 8, 2011 at 12:42 AM

Well, there could a be a number of issues causing the problem (look for an inner exception with Application_UnhandledException), but if you are using WPF it could be an issue with the default behavior of .NET to lazy load assemblies - I discussed this issue with solutions here:

Also in the same question you can an example of how to define services as singletons - i.e. basically set the Lifetime to be InstanceLifetime.Singleton.

Hope this helps,

wrote Feb 14, 2013 at 9:29 PM