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.

Make Exceptions Serializable

See original GitHub issue

Description

Currently AssertFailedException, AssertInconclusiveException, InternalTestFailureException, and UnitTestException are not marked serializable.

This presents a problem when executing tests in an different AppDomain. Since the exceptions are not serializable the runtime can’t move them between app domains and throws SerializationException.

AB#1575813

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:3
  • Comments:8 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
Evangelinkcommented, Jul 12, 2022

@Haplois The effort is minimal so that’s probably still worth implementing it even if we know that app domains are no longer a thing for .net core.

0reactions
Evangelinkcommented, Jul 12, 2022

We need a bit of investigation but maybe we will have to wait for the v3 as SerializableAttribute isn’t available in portable class libs.

Read more comments on GitHub >

github_iconTop Results From Across the Web

What is the correct way to make a custom .NET Exception ...
Complete implementation of a custom serializable exception ... Override GetObjectData() and make sure you call through to base.
Read more >
The Art of .NET Custom Exceptions | by bytedev - Medium
Custom exceptions are not serializable by default. But making a custom exception serializable allows it to be properly marshalled across app domains and...
Read more >
How to create user-defined exceptions with localized ...
To create a custom exception, follow these steps: Create a serializable class that inherits from Exception. The class name should end in ...
Read more >
How to Serialize Exceptions as JSON in .NET
Demonstrate how to serialize exceptions in .NET with elaborate explanation, guidelines and practical examples.
Read more >
Make Exception Classes Serializable
Mark the exception type with the [Serializable] attribute. · Add an empty protected serialization constructor that simply delegates to the base ...
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