question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Chaining multiple SerializeAsync/DeserializeAsync - header data issue

See original GitHub issue

I need to serialize two FullTextIndex instances into a single file.

When trying to read the file, I receive the following error:

System.AggregateException: One or more errors occurred. (Unable to read header data from serialized index content.)

My deserialization is done inside a task:

return Task.Run(async () =>
{
   await serializer.DeserializeAsync(index1, stream, disposeStream: false);
   await serializer.DeserializeAsync(index2, stream, disposeStream: true);
});

The index is serialized by separate program similarly inside a Task.

return Task.Run(async () =>
{
   await serializer.SerializeAsync(index1, stream, disposeStream: false);
   await serializer.SerializeAsync(index2, stream, disposeStream: true);
});

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
tomcashmancommented, Jul 25, 2022

It works perfectly. Thank you so much! 😃

0reactions
mikegoatlycommented, Jul 26, 2022

No problem, @tomcashman glad it worked for you! I’d love to find out how you get on with it once you’ve got things up and running fully - feel free to reach out on twitter (same username there) if you want.

Read more comments on GitHub >

github_iconTop Results From Across the Web

0
The problem that I'm running into is that the System.Text.Json.JsonSerializer doesn't return when trying to deserialize data in PipeStream ...
Read more >
refit/README.md at main
Redefining headers. Unlike Retrofit, where headers do not overwrite each other and are all added to the request regardless of how many times...
Read more >
JsonSerializer.DeserializeAsync Method (System.Text.Json)
Reads the UTF-8 encoded text representing a single JSON value into a returnType. The Stream will be read to completion.
Read more >
NDepend Report
The present HTML report is a summary of data gathered by the analysis. It is recommended to use the NDepend interactive UI capabilities...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found