如何在Vs2012中更改异常信息?

10
大约6个月前,我为了开个玩笑,更改了同事电脑上的异常文件,以便在出现NullReferenceException时,他会收到一个有关自己的有趣故障排除提示 - 我们有一个关于他在地下室剁肉的玩笑......
这件事情被我遗忘了,现在6个月过去了,这个错误再次出现,虽然很搞笑,但也需要修复并改回来。
你有任何想法如何改回来吗?或者哪个文件应该被更改?我的所有谷歌搜索似乎都指向文件例外...
(对于那些好奇它看起来是什么样子的人...) enter image description here
1个回答

7

包含VS2012自定义故障排除提示的文件为:

C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\ExceptionAssistantContent\1033\DefaultContent.xml

这是NullReferenceException代码块应该如何写的示例:
<Exception>
    <Type>System.NullReferenceException</Type>
    <Tip HelpID="EHNullReference">
        <Description>Use the "new" keyword to create an object instance.</Description>
    </Tip>
</Exception>
<Exception>
    <Type>System.NullReferenceException</Type>
    <Tip HelpID="EHNullReference">
    <Description>Check to determine if the object is null before calling the method.</Description>
    </Tip>
</Exception>

恭喜你成功恶作剧,我得记住这个!


干杯!如果你忘记了6个月以上就更好了! - Stuart.Sklinar

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接