Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在定义一个自定义异常类,以向我的处理程序发出信号以采取特定操作。我想知道是否应该使我的异常可序列化。我不打算将异常用作当前执行的退出。
(是的,我确实需要一个自定义异常类。我很确定)
最佳实践是使它们可序列化。通过这种方式,它们可以跨 AppDomain 甚至进程边界进行序列化。