Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7527533
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T04:07:49+00:00 2026-05-30T04:07:49+00:00

Getting a parser error when trying to serialize a ulong array, looks like the

  • 0

Getting a parser error when trying to serialize a ulong array, looks like the Json.NET library isnt checking if the integer is signed or unsigned; any one know of a workaround for this? or any other .NET Json library that can handle unsigned int’s?

*EDIT: code below; *
It serializes fine, but when its deserializing it throws an error; Looks like it doesnt cater for the unsigned int from looking at the stack trace;

NewTonsoft.Json.JsonReaderException : {"JSON integer 18446744073709551615 is too large or small for an Int64."}

Value was either too large or too small for an Int64.
   at System.Number.ParseInt64(String value, NumberStyles options, NumberFormatInfo numfmt)
   at System.Convert.ToInt64(String value, IFormatProvider provider)
   at Newtonsoft.Json.JsonTextReader.ParseNumber() in d:\Development\Releases\Json\Working\Src\Newtonsoft.Json\JsonTextReader.cs:line 1360
   class Program
        {
            static void Main(string[] args)
            {
                string output = JsonConvert.SerializeObject(new ulong[] {ulong.MinValue, 20, 21, 22, ulong.MaxValue});
                Console.WriteLine(output);

                ulong[] array = JsonConvert.DeserializeObject<ulong[]>(output);
                Console.WriteLine(array);

                Console.ReadLine();
            }
        }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T04:07:51+00:00Added an answer on May 30, 2026 at 4:07 am

    You’re right, JSON.Net doesn’t handle values larger than long.MaxValue in this case.

    I didn’t find any way to modify that behavior, except by modifying the source code of the library. As a workaround, you could deserialize it as decimal[] and then convert that into ulong[].

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Im trying to parse twitter trends but i keep getting a parser error at
I'm getting a ton of errors trying to install Rails 3.1.1. The error looks
I'm getting the error: parser error : Input is not proper UTF-8, indicate encoding
i am developing parser using bison...in my grammar i am getting this error Here
Im trying to display this listview, but I keep getting a: 07-17 21:14:22.233: ERROR/AndroidRuntime(349):
I keep getting the following error when trying to parse some html using BeautifulSoup:
Following an advice in the answer: subclassing beautifulsoup html parser, getting type error ,
I'm trying to getting this http://www.forgottenexpanse.com/projects/ci_reader CodeIgniter library for interacting with Google Reader to
I am getting this error while trying to Parse the Xml response from the
I'm trying to parse SQL search conditions and having trouble getting the parser to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.