I have an annoying problem with Visual Studio 2008.
When I run the “format code” command (“control+k, control+d”) — it will insert a carriage return. How do I get it to stop doing this???
For example:
<label for="shipCompanyName">Company Name:</label>
undesirably becomes
<label for="shipCompanyName">
Company Name:<label />
Answers:
Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.
Method 1
Go to Tools, Options. Open Text Editor, HTML, and Format. Uncheck “Wrap tags when exceeding specified length”.
Oddly, VS2008 doesn’t have the same option for XML.
Method 2
I use ReSharper.
You can configure whether to wrap or not in ReSharper.
ReSharper -> Options -> C# -> Formatting Style -> Line Breaks and Wrapping -> Wrap long lines
All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0