
Hi all
I make a solution that is working perfect on my environment. When I import it on another environment and try to test. It gave me the below error:
Workflow paused due to error: Unhandled Exception: System.TypeInitializationException: The type initializer for 'Newtonsoft.Json.JsonWriter' threw an exception.
at Newtonsoft.Json.JsonWriter..ctor()
at Newtonsoft.Json.JsonTextWriter..ctor(TextWriter textWriter)
at Newtonsoft.Json.JsonConvert.SerializeObjectInternal(Object value, Type type, JsonSerializer jsonSerializer)
at Newtonsoft.Json.JsonConvert.SerializeObject(Object value, Type type, JsonSerializerSettings settings)
at Newtonsoft.Json.JsonConvert.SerializeObject(Object value)
at Integration.CRMIntegration.Execute(CodeActivityContext context)
at System.Activities.CodeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager)
at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)
Inner Exception: System.ArgumentException: Value does not fall within the expected range.
at System.Runtime.CompilerServices.RuntimeHelpers.InitializeArray(Array array, RuntimeFieldHandle fldHandle)
at Newtonsoft.Json.JsonWriter..cctor()
This error is in my workflow from which I trigger my custom workflow. In my custom workflow I used some libraries.
I do not know What happen and Why it is giving this error?
Please help me. My product is getting late and late. I need help from your side.
Thank You
*This post is locked for comments
I have the same question (0)Hi Abdul,
It looks like you have a custom workflow activity "Integration.CRMIntegration.Execute", and in the process of calling that, something is being serialized and is erroring out but it's tough to tell from the stack trace. It looks like it could be an exception in setting a field value (it's 0-100 and you're setting it to 200).
Hope this helps! I'd appreciate if you'd mark this as Answering your question.
Thanks,
Aiden