Resolution of the dependency failed

Mar 5, 2012 at 5:21 AM

Hi,

 

I am getting the following exception. If anyone has encountered the error before please let me know the solutions.

System.ServiceModel.FaultException`1[System.ServiceModel.ExceptionDetail]:
 Resolution of the dependency failed, type =
 "OpenSolutions.LoanMaintenance.Services.Account.IAccountService",
 name = "(none)".
 
 
 
Exception occurred while: Calling constructor
 Microsoft.Practices.Unity.InterceptionExtension.PolicyInjectionBehavior(Microsoft.Practices.Unity.InterceptionExtension.CurrentInterceptionRequest
 interceptionRequest,
 Microsoft.Practices.Unity.InterceptionExtension.InjectionPolicy[] policies,
 Microsoft.Practices.Unity.IUnityContainer container).
 
 
 
Exception is: ResolutionFailedException - Resolution of the
 dependency failed, type =
 "Microsoft.Practices.Unity.InterceptionExtension.ICallHandler", name
 = "a1d99da8-ed31-429c-88c3-4df56bb601a7".
 

Exception occurred while: while resolving.
 

Exception is: InvalidOperationException - Currently
 composing another batch in this ComposablePartExportProvider. Only one batch can be composed
 at a time.
 
-----------------------------------------------
 
At the
 time of the exception, the container was:
 
 Resolving OpenSolutions.Sys.ServiceModel.Servi...
 (Fault Detail is equal to An ExceptionDetail, likely created by
 IncludeExceptionDetailInFaults=true, whose value is:
 
 
 
Microsoft.Practices.Unity.ResolutionFailedException:
 Resolution of the dependency failed, type =
 "OpenSolutions.LoanMaintenance.Services.Account.IAccountService",
 name = "(none)".
 
Exception occurred while: Calling constructor
 Microsoft.Practices.Unity.InterceptionExtension.PolicyInjectionBehavior(Microsoft.Practices.Unity.InterceptionExtension.CurrentInterceptionRequest
 interceptionRequest, Microsoft.Practices.Unity.InterceptionExtension.InjectionPolicy[]
 policies, Microsoft.Practices.Unity.IUnityContainer container).
 
Exception is: ResolutionFailedException - Resolution of the
 dependency failed, type =
 "Microsoft.Practices.Unity.InterceptionExtension.ICallHandler", name
 = "a1d99da8-ed31-429c-88c3-4df56bb601a7".
 
Exception occurred while: while resolving.
 
Exception is: InvalidOperationException - Currently
 composing another batch in this ComposablePartExportProvider. Only one batch
 can be composed at a time.
 
 
 
-----...).
 
 Thanks

Pushkar

Mar 6, 2012 at 5:38 AM

It looks like your original exception is: "InvalidOperationException - Currently
 composing another batch in this ComposablePartExportProvider. Only one batch
 can be composed at a time."

It looks like you might be using a CompositeContainer from multiple threads.  Hopefully this and this can help.

--
Randy Levy
Enterprise Library support engineer
entlib.support@live.com 

Mar 6, 2012 at 5:54 AM

Yes, we are using container for multiple threads. But how can we allow multiple threds with no exception.

Thanks for your early response.

Regards,

Pushkar

Mar 6, 2012 at 6:03 AM

Hi,

Even passing the threadSafe value to true doesn't solve the problem in my case.

CompositionContainer(ComposablePartCatalog catalog, bool threadSafe, params ExportProvider)

Thx.

Pushkar

Mar 6, 2012 at 3:48 PM

I think that the MEF Discussion forum might be able to provide help about CompositionContainer.

--
Randy Levy
Enterprise Library support engineer
entlib.support@live.com