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.
我们正在尝试退出进程以获取会话状态,当然,我们需要将我们打算存储在会话中的类标记为可序列化。
有没有办法自动确定哪些类应该被标记为可序列化,而不需要对站点进行全面的回归测试来通过黄屏将它们清除掉?
看一下这个 ;)
[Serializable] public class SessionObject { } static void Main(string[] args) { bool isSerializable = typeof(SessionObject).GetCustomAttributes(typeof(SerializableAttribute), false).Length != 0; }