When adding an inline comment to VB.NET code, the following lines are colored as strings:

dim a as integer
a += 1 'And here is the comment which turns the next line(s) into strings.
dim b as integer = a * 2
  • for some reason, the behaviour i'm describing was evident while writing the bug report, but not when viewing it. To see it on a posted question, go to stackoverflow.com/questions/5109302/… – GilShalit Feb 24 '11 at 21:36
  • Use two quotes '' in your snippet to avoid this. – Uphill Luge Feb 24 '11 at 22:01
  • Hans - are you following me around and answering my questions ? :-) Yes, the two quotes helped! – GilShalit Feb 24 '11 at 22:17
  • This is a duplicate...I'm just too lazy to look it up right now. And yes, it's the ', just add a closing one after the comment. – Time Traveling Bobby Feb 24 '11 at 22:26
  • 1
    Duplicate and duplicate feature request – MarkJ Apr 18 '11 at 10:16

As long as your question is correctly tagged it should be fine in the final question.

The preview will show a more generically rendered code preview, so don't hold that as gospel.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .