What does purple underline mean in visual studio editor?

I come across some purple (or purple?) Underscores in Visual Studio 2015 today, which I have never seen before.

purple underline in Visual Studio

I moved the cursor over the text, but nothing happened (sometimes it happens). I looked for him and received nothing.

What does it mean? How do different types of underscores represent different types of warnings in VS?

Here are some tips: Later, I found myself editing the source while the program was still running. When I stop the program, the underline disappears. Therefore, I assume this has something to do with the current state of debugging.

+11
source share
2 answers

In this case, you see purple editing, because you change the code while it is running. see https://msdn.microsoft.com/en-us/library/ba77s56w.aspx :

When you make an unauthorized change, that change is marked with a purple wavy underline and the task appears in the task list. You must cancel unauthorized editing if you want to continue using Edit and Continue. Some unauthorized changes may be allowed if they are made outside of Editing and Continuing. If you want to save the results of such unauthorized editing, you must stop debugging and restart the application.

A purple underline can also be displayed if there is an error in the code that will not be launched due to some circumstances, for example, #IFDEF. see https://msdn.microsoft.com/en-us/library/dn957937.aspx :

The purple squiggle appears in the general project when there is no error in the code, for example, when you work in the Windows context, but enter what would be an error in the Android context. A red curve indicates a compiler error or warning in the active code that you need to deal with.

+13
source

This also happens in the comments, for spelling mistakes. Annoying.

0
source

Source: https://habr.com/ru/post/1263124/


All Articles