I type the code below:
if (rows == 0) break;
and when I add the semicolon at the end, VS springs into action and converts it to:
if (rows == 0)
break;
Same thing happens with if (rows = 0) return;
and some other constructs.
How can I prevent VS from formatting this specific code interaction without messing with all the other niceties that it provides? I looked in Tools/Options/Text Editor/C#/Code Style/Formatting, but don't see anything obvious.
you add pragam waning disable settings, so when you do Ctr+K+D it will not format or whatever shortcut keys you may be using to format.
#pragma warning disable format
public class Item
{
public string Prop1 { get; set; }
public string Prop2 { get; set; }
}
#pragma warning disable format
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.