web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Error in moving solution from one environment to another

(0) ShareShare
ReportReport
Posted on by 12,119 Moderator

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)
  • Suggested answer
    Aiden Kaskela Profile Picture
    19,696 on at

    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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans