How do I make Visual Studio show objects value inline when debugging - c#

When debugging, I would like to see objects value shown inline as you stepping through each line of code. I've seen this feature in some of my colleagues VS but I could not find any option to turn it on.

Visual Studio cannot do that by itself.
What you have most likely witnessed is the new Resharper feature. If your colleagues have this, there is a good chance your company will provide it for you, too. Don't hesitate to ask your manager for a licence, it's a great tool and will make you more productive.
(Disclaimer: I'm in no way affiliated with the company. I just think they have a great product.)

The inline hint is a new feature in Visual Studio 16.8. But we have to enable it manually.
Go to Tools in the top bar, then click on options.
Go to Text Editor in the left menu, and expand it.
Then go to C# Expand it, and go to advanced.
Now in the right-side options go to section Editor help.
Enable "Display Inline Parameter name hints (experimental)".

In the menu, go to:
Debug -> Windows -> Output

Related

Visual Studio 2022 not showing syntax errors and Intellisense is not working properly

Working on a project I made a class with properties and when I tried to auto-generate a class constructor I got an error saying something on lines of "auto generation of class constructor failed... and will be disabled" and ever sense then the "generate constructor" option has been taken off the Refactor menu and on top of that I don't get syntax error highlighting anymore and intellisense doesn't seem to be working proper or at all.
I tried using going into Tools > Options > Text Editor > various fields including "C#" and "general") and I don't see anything obviously wrong. I also tried to use Visual Studio Installer to try to repair and that didn't do anything. I am completely out of ideas and I can't find anything that is remotely close to my case. TIA
I can't add this reply as a comment as I don't have 50 reputation.
I created a .Net 6.0 C# console project in Visual Studio 2022, add a class, and add two private fields. Selecting these two fields, press Alt+Enter to quickly generate the constructor. I did not encounter your issue.
Please try:
Go to Visual Studio Installer, click Modify, uncheck IntelliCode in Individual components, then click Modify button to save the change, wait for the installation to complete, and then reinstall IntelliCode.
In Visual Studio, go to Tools->Options->IntelliCode to check if the setting is Default.
Go to Tools menu, and select Options. Under Intellicode select General. Just uncheck “C# Suggestions”. Then restart Visual Studio and check that intellisence and syntax errors are appearing.
Note, I was not able to figure out what this option does, as the C# code suggestions seemed to continue to work as expected.

Disable 'Show live semantic errors' for C# in Visual Studio 2017

In Visual Studio 2013, I could un-check the option "Show live semantic errors" under Tools → Options → Text Editor → C# → Advanced.
This functionality is painfully distracting, and I would love to turn it off. Unfortunately, this options was removed back in Visual Studio 2015, and is still not back in Visual Studio 2017.
Is there any way to somehow disable this option for 2017? I have searched everywhere I can think of... Does anyone have any ideas?
The behavior I find distracting/frustrating/etc. is the constant visual notification that there is something wrong with my code. Specifically WHILE I am writing something...
As a very simply example:
/// <summary>
///
/// </summary>
public class MyClass
{
public string DoSomething()
{
}
}
'DoSomething' will be identified (via red squiggly line) as not returning a value. If I am in the process of writing my method I don't want to be reminded it is wrong. This example, although rather simple, is an illustration of the problem. The real-time error-highlighting can get really distracting as things get more complicated. I know many have suggested making the 'squiggle' color the same as the background color. The problem there is that once I compile, I WOULD like to see those squiggles...
I have disabled all Analyzers at the solution level AND the project level.
You are not the only one to ask for this option ... You may take a look here for confirmation
But according to one of the comment visible on that link, you may still disable the full solution analysis:
IMHO, the new checkbox in VS2015 Update 3 which allows you to toggle
off/on the "Enable full solution analysis" option is a step in the
right direction
(https://msdn.microsoft.com/en-US/library/mt709421(VS.140).aspx) - but
it still doesn't enable you to eliminate ALL solution analysis.
Currently that is impossible. You can request to bring this feature back and present your argument in How to disable live code compilation/analysis in Visual Studio 2017? Roslyn issue on GitHub.
There is no relevant option in Visual Studio. You can't change squiggle (wavy line) style because Visual Studio uses same style named Syntax Error both for design-time errors and compile-time errors. Roslyn that comes with Visual Studio ignores relevant registry keys. See Performance considerations for large solutions page in Roslyn GitHub Wiki. Although Language Service and Editor have relevant extension points, they wouldn't let you alter Visual Studio default behavior. See Extending the Editor and Language Services page on MSDN.

VS2015 update 2: "Initialize Interactive with Project" option missing

According to the Visual Studio 2015 update 2 release notes, it is now possible to initialize the C# interactive environment with the context of a selected project. This feature is further described in these blog posts. However, the "Initialize interactive with project" menu option they talk about and show in screenshots simply isn't present for me (though I do see the related new "Execute in interactive" option when I select code in the editor).
I'm using:
Any clue what might be wrong? Does anyone else see this feature?
Update: Just to prove it's really not there:
Right click on your project and you'll see the option in the context menu.
Within the code window Right-Click you will see it there. Perform the right click as if you are trying to right click on a function. You can execute an entire function.
You can actually right click anywhere in the code window.
I'm using Visual Studio Community 2015 Update 2, and I can see the expected menu option by right-clicking a console project, so it should be available for you too.
I just wonder if you can see and use View > Other Windows > C# Interactive
Maybe if you double check the installed components through the Visual Studio setup and/or do a Repair by Visual Studio setup can bring it back for you.

Microsoft Visual C# 2010 Express intellisense not working

I tried googling, but I couldn't find a fix.
Before, when writing:
console.writeline();, C# would automatically uppercase it to Console.WriteLine();.
Now, by mistake, I somehow deactivated that function. If I write console.writeline(), it doesn't turn it into Console.WriteLine();. Any ideas?
What your looking for is called: Intellisense
The sole goal of this feature is to allow coding to be more productive, smarter, and easier.
You can renable Intellisense by hitting CTRL + J. That will manually reactivate it. Otherwise you'll need to go to:
Tools
Options
Text Editor
Auto List Member
But one of those should address your issue. Otherwise I might suggest running a repair on Visual Studio or Restoring it back to defaults. Cause by default it is enabled and configured correctly.
A known issue can also come from third-party Add Ons that actually handle such data can cause issues with Intellisense so uninstalling such Add Ons, then defaulting Visual Studio should fix it as well.
Example:
Resharp
Visual Assist X
Just Code
Etc.
Basically the ones that handle code completion, quick coding features.
Here is an article from Microsoft Developer Network.
Hopefully that helps.

Can't see Methods, etc. in Visual Studio 2008 C# Code

I typically code in VB.NET, but I'm going through a tutorial in C# .NET right now. I'm expecting to see a drop down list for selecting methods and properties at the top of the code file, right underneath the tabs for the code files I have open. However, I do not see these. If I open VB code, it works just fine. I've tried to look for an option in Visual Studio that I don't have turned on, but I can't find what I'm missing. Anybody have any ideas?
Go to Tools->Options->Text Editor->C#->General and check "Navigation Bar"
If you want to access the events, you can do it on design mode on upper border of the properties box, there is a "thunder" where you can access them, this part is different from that of VBasic
Tools Menu --> Options
Text Editor ---> C# ----> General ----> Navigation Bar (check this box)
Reset your entire environment. Tools--> Import and Export Settings... from this dialog you can reset your IDE settings, choosing to Reset all environment settings to one of the default collections of settings. (VB Developer, C# Developer, Web Developer, Project Manager...)

Categories