I try to build exception message with 3 lines. But when I try to put Environment.NewLine into the message I get double new line symbol. See the screenshot below.
How can I solve the issue?
I try to build exception message with 3 lines. But when I try to put Environment.NewLine into the message I get double new line symbol. See the screenshot below.
How can I solve the issue?
try replace "\r\n" ==> (Environment.NewLine)
I think you are asking if you can configure the Visual Studio IDE to display exceptions with single-spaced line breaks in that little window. I don't think it allows that sort of customization. If it really bothers you that much, you can look into Visual Studio extensions.
On a side note, you should consider shortening the exception message. If that much detail is really needed, think about using logging instead.