Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Error in moving solution from one environment to another

Posted on by 12,070 Super User 2024 Season 1

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

  • Suggested answer
    Aiden Kaskela Profile Picture
    Aiden Kaskela 19,692 on at
    RE: Error in moving solution from one environment to another

    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

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans