Reputation: 29710
We are attempting to go out-of-proc for session state, and need to mark the classes we intend to store in session as Serializable, of course.
Is there any way to automatically determine which classes should be marked as Serializable, without resorting to full regression testing of the site to flush them out via yellow screens?
Upvotes: 0
Views: 403
Reputation: 60516
Check this out ;)
[Serializable]
public class SessionObject
{
}
static void Main(string[] args)
{
bool isSerializable = typeof(SessionObject).GetCustomAttributes(typeof(SerializableAttribute), false).Length != 0;
}
Upvotes: 1