警告代码cs0618和cs0612有什么区别

编程入门 行业动态 更新时间:2024-10-09 17:25:40
本文介绍了警告代码cs0618和cs0612有什么区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

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

cs0618 和 cs0612 。

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有什么区别

本文发布于:2023-11-13 06:12:44,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1583661.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:有什么区别   代码

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!