When we try to generate a database instance using Entity framework and Factory methods, we have received the error “Resolution of the dependency failed“.
Solution:
Include the following libraries in the class, where we create the database instance
Microsoft.Practices.EnterpriseLibrary.Common
Microsoft.Practices.EnterpriseLibrary.Data
Microsoft.Practices.ServiceLocation
then use following line to get the database instance
var db = EnterpriseLibraryContainer.Current.GetInstance<Database>();