gpt4 book ai didi

c# - visual studio editor中的紫色下划线是什么意思?

转载 作者:IT王子 更新时间:2023-10-29 04:38:50 25 4
gpt4 key购买 nike

我今天在 Visual Studio 2015 中遇到一些紫色(或紫罗兰色?)下划线,这是我以前从未见过的。

purple underlines in Visual Studio Editor

我将光标放在文本上但没有任何反应(有时会发生)。我在谷歌上搜索了一下,但一无所获。

这是什么意思? VS中不同类型的下划线如何表示不同类型的警告?

这里有一些提示:后来我发现自己在程序仍在运行时编辑源代码。当我停止程序时,下划线消失了。所以我推测这与调试的当前状态有关。

最佳答案

在这种情况下,您会看到紫色编辑,因为您在代码运行时对其进行了修改。见https://msdn.microsoft.com/en-us/library/ba77s56w.aspx :

When you make an unauthorized edit, the change is marked with a purple wavy underline and a task is displayed in the Task List. You must undo an unauthorized edit if you want to continue to use Edit and Continue. Certain unauthorized edits may be permitted if done outside Edit and Continue. If you want to retain the results of such an unauthorized edit, you must stop debugging and restart your application.

当代码中出现错误且由于某些情况(例如 #IFDEF)而无法运行时,也可能会显示紫色下划线。见https://msdn.microsoft.com/en-us/library/dn957937.aspx :

A purple squiggle appears in a shared project when there is an error in code that is not currently active, for example when you are working in the Windows context but enter something that would be an error in an Android context. A red squiggle indicates a compiler error or warning in active code that you need to deal with.

关于c# - visual studio editor中的紫色下划线是什么意思?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41775235/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com