Is it possible to have a compile time check that a type is marked with the Serializable attribute

后端 未结 2 1005
无人共我
无人共我 2021-01-07 15:27

Specifically we\'re making our application compatible with the Out Of Process Session State server where all types saved in session must be serializable.

Is there

2条回答
  •  情书的邮戳
    2021-01-07 15:47

    You could write a custom FxCop rule to generate warnings for this scenario.

    Jason Block has a sample rule on his site.

提交回复
热议问题