What is the difference between warning codes cs0618 and cs0612

爷,独闯天下 提交于 2019-12-13 12:53:20

问题


I have seen both of the following warning codes being thrown for utilization of code marked obsolete.

cs0618 and cs0612.

0618 is Level 2 and 0612 is level 1 according to the documentation. Does anyone know what the difference is between these codes is and what causes one to be thrown instead of the other?


回答1:


I think the difference is that one contains a message and the other doesn't.

[Obsolete]                                  // CS0612
[Obsolete("Use newMethod instead", false)]  // CS0618
[Obsolete("Use newMethod instead", true)]   // CS0619


来源:https://stackoverflow.com/questions/10359117/what-is-the-difference-between-warning-codes-cs0618-and-cs0612

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!