c# - Is it possible to have a compile time check that a type is marked with the Serializable attribute -
specifically we're making our application compatible out of process session state server types saved in session must serializable.
is there way see @ compile time type put httpsessionstate marked serializable attribute. along lines of 'non-valid' code
public static void put<t>( string key, t value ) t : ismarkedwitheserializableattribute { httpcontext.current.session[key] = value; }
you write custom fxcop rule generate warnings scenario.
jason block has sample rule on his site.
Comments
Post a Comment