[TargetInvocationException: Exception has been thrown by the target of an invocation.]
System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck) +0
System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark) +119
System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark) +232
System.Activator.CreateInstance() +117
Umbraco.Forms.Core.Common.Nested..cctor() +94
[TypeInitializationException: The type initializer for 'Nested' threw an exception.]
Umbraco.Forms.Core.Common.Singleton`1.getInstance() +35
Umbraco.Forms.Core.Workflow.getType() +127
I've tried property and Method injection and both values set on OnApplicationStarted but when the workflow kicks off and a new instance is created the property and Method are not reset and return a null reference.
Custom Workflow error with Autofac
Hi
Im getting the below when implementing Autofac on a custom workflow. "No parameterless constructor defined for this object"
Logger: Umbraco.Forms.Core.Common.ProviderBase
how do i register the workflow with Autofac?
---------------------Stack-------------------- [MissingMethodException: No parameterless constructor defined for this object.] System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck) +0 System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark) +119 System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark) +232 System.Activator.CreateInstance(Type type, Boolean nonPublic) +83 System.Activator.CreateInstance(Type type) +11 Umbraco.Forms.Core.Common.ProviderCollection
1.registerProviders(List
1 types) +364 Umbraco.Forms.Core.Common.ProviderCollection1.initialize() +277 Umbraco.Forms.Core.Common.ProviderCollection
1..ctor() +66 Umbraco.Forms.Core.Providers.WorkflowTypeProviderCollection..ctor() +4[TargetInvocationException: Exception has been thrown by the target of an invocation.] System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck) +0 System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark) +119 System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark) +232 System.Activator.CreateInstance() +117 Umbraco.Forms.Core.Common.Nested..cctor() +94
[TypeInitializationException: The type initializer for 'Nested' threw an exception.] Umbraco.Forms.Core.Common.Singleton`1.getInstance() +35 Umbraco.Forms.Core.Workflow.getType() +127
I did not find a way to do it, the simplest way is use
DependencyResolver.Current.GetService<IYOUSERVICE>()
I've tried property and Method injection and both values set on OnApplicationStarted but when the workflow kicks off and a new instance is created the property and Method are not reset and return a null reference.
Any ideas?
is working on a reply...