问题
When I build my C# code in Visual Studio 2015 using the default compiler (nothing unusual about the project), I get output in the output window that looks a bit like this. (The actual width isn't representative, as I've replaced the rather long path with XXX
.)
1>XXX(402,13,402,16): error CS1955: Non-invocable member 'Lo
1>g' cannot be used like a method.
1>XXX(424,25,424,28): error CS1955: Non-invocable member 'Lo
1>g' cannot be used like a method.
Presumably the compiler is printing Non-invocable member 'Log' cannot be used like a method
, and something, somewhere, is stepping in and popping newlines in (at column 120 in practice - as mentioned, column counts in my example output are unrepresentative).
Can I stop this? If so, how?
I'd much prefer the messages to be printed out with newlines in natural places, so I can use the output window's word wrap functionality.
回答1:
After you open the Package Manager Console, build output starts to become wrapped as above.
The fix appears to be to restart Visual Studio.
回答2:
Wow, I almost gave up finding someone asking this question. I can confirm the behavior described and restarting VS fixes it. Thanks!
来源:https://stackoverflow.com/questions/38456668/how-do-i-stop-the-c-sharp-compiler-output-from-wrapping-in-the-visual-studio-201