Hi, I'm facing with this error in my custom Form workflow:
Could not resolve 'MyCustomFormWorkflow' from root provider because it requires scoped service 'Umbraco.Cms.Core.Security.IMemberManager'
when I try to DI the IMemberManager. What should I do?
m
Maarten
07/13/2023, 10:53 AM
Did you also register MyCustomFormWorkflow to the DI container?
d
david_66
07/13/2023, 10:55 AM
Copy code
csharp
public class CustomWorkflowComposer : IComposer
{
public void Compose(IUmbracoBuilder builder)
{
builder.WithCollectionBuilder<WorkflowCollectionBuilder>()
.Add<MyCustomFormWorkflow>()
}
}
david_66
07/13/2023, 10:55 AM
Do you mean this?
m
Maarten
07/13/2023, 10:58 AM
Yeah was just checking, but I think what it says is that it can't create the workflow as the workflow isn't a scoped dependency but it's probably a Singleton, so you can't have a scoped depdendency in your workflow.