警告代码cs0618和cs0612有什么区别 [英] What is the difference between warning codes cs0618 and cs0612

查看:88
本文介绍了警告代码cs0618和cs0612有什么区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经看到以下两个警告代码都被抛出,以利用标记为过时的代码。



cs0618 cs0612



<根据文档,p> 0618是2级,而0612是1级。有谁知道这些代码之间的区别是什么,什么原因导致抛出一个而不是另一个?

解决方案

我认为

  [已淘汰]  CS0612 
[ Obsolete(使用newMethod代替,false)] // CS0618
[Obsolete(使用newMethod代替,true)] // CS0619


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?

解决方案

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

这篇关于警告代码cs0618和cs0612有什么区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆