Have Visual Studio output window color messages according to log level? - visual-studio

When running an app in Visual Studio I love having colored messages in the console window. But is it possible to have colors showing in the Output window as well? Right now it's all monochrome.

Try this extension. I used it for VS 2022 and works really good. You can even configure which color you want to see.
link for VS2022 marketplace - VSColorOutput64
Link for another extension - Output enhancer

Related

How to clear the output window in Visual Studio 2022 before each run automatically

I have a simple .NET Core 6 application, developed via Visual Studio Community 2022.
When I press the start button in the standard toolbar, it appends the logs in the output window.
If I want to distinguish the start point of the recent run in the log's lines, I must search in the console.
There is a button in the top corner of the output window for clearing the console before the next run.
My question is, is there any setting in Visual Studio that I can set, to clear this output window automatically in each run before starting logging?
Here's my cheat-to-win workaround. It's not exactly the same as clearing the output window but it sure gets rid of the noise.
Debug.WriteLine(string.Join(Environment.NewLine, Enumerable.Repeat(string.Empty, 100)));
In the past I would use the technique shown here EnvDTE80.DTE2 to do a legitimate Clear but apparently there's no support for System.Runtime.InteropServices.Marshal.GetActiveObject in net core as mentioned here .Net Framework but not for .Net Core

Visual Studio 2019 - can't change profile settings, opens FolderProfile.pubxml instead

I have a problem with Visual Studio 2019.
From what I have seen in tutorials, during publishing an application, I should be able to change profile settings, by clicking a small pencil (I included a screenshot, it's a little pencil next to "false" and other settings.) However, every time i click it, it opens FolderProfile.pubxml file in Visual Studio instead! Is this indended behaviour, am I doing something completely wrong? How to change that? Screenshot
My problem fixed when I updated visual studio.
Also go to extensions and update all.
Now show UI options.

Code color code and highlighting for unity

I have just starting learning how to make games in Unity, using Visual Studio as the Script Editor, I see other people have their Code colour coded and it also has auto completion.
I've followed some tutorials online but nothing has worked for me.
what do I have to install to get it working?
To add auto-completion you have to add the unity visual studio package. To add this package please type in your windows search field: "Visual Studio Installer" and then click at the visual studio version the button "change". After that, a new window opens in this window click the field with the unity package and then install this package. Now you have auto-completion in Visual Studio.
To add colors look this video: https://www.youtube.com/watch?v=_g1TyAGk6Lk& I really recommend this color theme.
The Color Coding of Code can be found on the Tools>Options>Environment>Fonts and Colors. For example, you want to change the color for the Operators (+, -, /, *, etc.), you would need to find it in the Display items List and edit (found on the Right Side of the Display Items) the color of the foreground (the text itself), it's background or whether it is displayed in bold or not.
I believe that auto completion or IntelliSense is on by default as for what I have Experienced in switching from MonoDevelop to Visual Studio 2017.
Actually, i think you're looking at a popular visual studio plugin called Resharper;
https://www.jetbrains.com/resharper/
It also has a Unity3D plugin (for resharper) which adds full support. That's were the coloring and extra intellisense comes from.
You can see some sample pictures here; https://github.com/JetBrains/resharper-unity

Visual Studio output window- what goes there and why?

Can someone please explain to me what goes to the Output window in VS? Where do the messages there come from and do they have other use other than for debbuging?
Thanks.
The Output window is a set of text panes that you can write to and read from. Visual Studio defines these built-in panes: Build, through which projects communicate messages about builds, and General, through which Visual Studio communicates messages about the integrated development environment (IDE). Projects receive a reference to the Build pane automatically through the IVsBuildableProjectCfg interface methods, and Visual Studio offers direct access to the General pane through the SVsGeneralOutputWindowPane service. In addition to the built-in panes, you can create and manage your own custom panes.
Output Window (Visual Studio SDK)
This panel shows the actual info, that is spit from your application to the console (no matter debug or run mode). Also building, rebuilding and cleaning your project is described as operations there.
Check F1 for more info ;)
By default it either shows output from the build process, or debugger output. You can use OutputDebugString to display text in the output window while debugging.
There's not much else you can do with it without using an Add-In for Visual Studio.

Colored build output in Visual Studio

I am using a Visual Studio project with custom build script/batch file (ala make, ant, etc.).
When the build is run from the command line we have placed colored highlighting on various output lines.
However, when built via Visual Studio (2005 in my case) the output window does not show the color anymore.
Is this possible? I am quite happy to put specific code into the build script if required.
If you don't want to go with the pro version of the VSCommands plug-in, there is a free one called VSColorOutput, which does just that. I've worked with it a bit, does what it says.
See http://coolthingoftheday.blogspot.com/2011/12/vscoloroutput-visual-studio-output.html or look it up in the extension gallery.
The VSCommands plug-in for Visual Studio 2010 adds colour formatting to the output window so errors are red. I'm not sure how they are doing it but it might give you a starting point.
The problem isn't with your build scripts, but with Visual Studio not supporting ANSI control codes to change the color.

Resources