Activate auto-complete for C# in Visual Studio 2019 - c#

I have the problem, that I get some suggestions for autocompletion
(for example, I type "Cons" and I get the suggestion for "Console"), but these can't be applied with the Return-key.
Normally, the suggestion is fully blue, and gets attached, when I press 'enter', but for some time now, the suggestion has a blue border and pressing 'enter' results in a new line.
Where can I change these settings, so IntelliSense completes the words again, while I write them?
I already tried the IntelliSense-Settings in the C#-options, but these settings didn't change anything

There are 2 different autocomplete modus in Visual Studio, suggestion mode has the behavior you describe. Suggestion and standard, explained here. Press CTRL-ATL-SPACE to toggle between these modes.

You likely inadvertently used the keyboard shortcut to toggle completion mode. You can correct it with the same shortcut or in the menu it's Edit -> InteliSense -> Toggle Completion Mode
To change InteliSense from Suggestion mode to Completion mode in VS 2019

In my experience, "Toggle Completion Mode" name changed into
Edit -> InteliSense -> "Switch between automatic and tab-only Intellisense completion"

Related

Prevent Visual Studio from switching tabs to show me warnings

I'm using Visual Studio Community for Mac (2017), which is different from the one on Windows (it's a "rebranded version of MonoDevelop"). Specifically, I'm using it to write ASP.NET, C#, JS, and CSS but I think the warnings are only for C# code.
Every time I run my code, I am taken from the tab I was just in to another tab where I have a warning. I find this switching extremely disorienting, so I need it to stop.
I don't need or want to fix the problem causing the warning right now. I know I can go to "Options" > "Compiler", then set "Warnings level" to 0, but I don't want to not see a list of the warnings I have.
How can I prevent it from switching my current tab around?
After suffering with this for too long, I finally figured out the solution.
Simply check the checkbox next to the error in the list (in the "error pad"):
It will be shown (at least at first) in strikethrough and it won't steal your tab focus anymore (unless you uncheck it).
You can either do this for every warning or you can go to Preferences (shortcut: command + comma) and set a setting so that they automatically get checked off. The setting is "Build" > "Jump to first error or warning" and I set it to "Error" since I like being taken to any problem that prevents things from compiling. If you want it to never steal your tab focus, you should set it to "Never".

Disable "Break Mode" page in VS2015

Recently migrated from VS2010 to 2015. Now when I pause a running app to work on it, I get this very annoying "Break Mode" page with "The application is in break mode". Well, no shoot Sherlock, I pressed pause. I know its in break mode. The page is annoying and takes me away from the code I was going to work on completely unnecessarily.
I didn't get this annoying page in 2010. I may have some setting switched back then on 2010 but too long to remember.
Is there a way to disable this silly break mode page in VS2015?
The best solution I've found so far is to drag the "Break Mode" tab to the bottom of your screen (so it is attached like a toolbar window) and make it as small as possible. Then when you pause and get this screen it at least doesn't cover your existing view.
There is a free extension to resolve this issue: Disable No Source Available Tab available for from the VS Market Place.
This small extension will prevent the tool window with title "No Source Available" from appearing in Visual Studio, and preserve the focus on the currently active tab.
Under Tools → Options → Debugging → CHECK "Use Managed Compatibility Mode"
I had this annoying problem, too and did not realise, that i turned the Exception Settings to "Break on all exceptions". Then there where some Exceptions in external Code, where the debugger stopped, but I could not see the code, as it was in a Framework. Pretty annoying.
To reset Exception Settings in VS2017:
ctrl+al+e -> right click on the opening window -> reset to defaults
Maybe this helps someone =)
Dont use this primarily. Use atchoum's solution. its the BEST.
Another option:
I like to use the keyboard instead of the mouse, so I invoke a pause with CTRL + ALT + BREAK(or you can click pause)
regardless this causes the annoying "Break mode" window to appear
When it comes up and assuming you still have the CTRL + ALT + BREAK keys held down- Just release the ALT and BREAK keys and hit the F4 key
This will close the annoying break mode window and take you to the page and spot your had the cursor on before you pressed the break combination of CTRL + ALT + BREAK.
So... in one foul swoop press
CTRL + ALT + BREAK (to enter break mode) and then
CTRL + F4 (to close the stupid "break mode" window and place the cursor where you were before you hit CTRL + ALT + BREAK )
I was having same problem and was tired of searching for a solution but, in end, I found out there was one error in my code at specific form; after changing that code I didn't got any break mode type error.
CODE WHEN ERROR (Break mode) OCCURRED
Private Sub TextBox1_TextChanged(sender As Object, e As KeyPressEventArgs) Handles TextBox1.TextChanged
CODE WHEN ERROR (Break mode) DIDN'T OCCUR
Private Sub TextBox1_TextChanged(sender As Object, e As EventArgs) Handles TextBox1.TextChanged
May be this can help so please check where and when your code triggers something.
To Disable "Break Mode" page go to:
Tools --> Options --> Debugging --> General
Uncheck the checkbox of "Enable Just My Code"

Reformatting code with R# in a single keyboard shortcut

Using the R# keyboard shortcut for formatting code presents the following window:
which forces me click the Run button every time.
Is there a way to bind a keyboard shortcut directly into the Reformat Code option, rather than just opening this dialog window?
Edit: To make things clear, I don't actually click the Run button with the cursor, I press Enter. (I still find it annoying, and wish for a direct shortcut.)
Oh sweet.. I just checked Tools -> Options -> Keyboard and found the command "ReSharper_SilentCleanupCode". It seems to execute ReSharper's code formatting function without popping up the dialog. Give it a try but try to not break your fingers... the default is ctrl-alt-shift-f :D That needs a rebind...
Although I can't answer the question directly I want to propose Ctrl-K-D as an alternative. This will invoke Visual Studio built-in formatting. It is less thorough but also less intrusive.

Your step-into request resulted in an automatic step-over of a property or operator

I am getting the following error message while running .net 3.5 applciation
Your step-into request resulted in an automatic step-over of a
property or operator.
This behavior can be overridden in the context menu for the line being
executed by choosing 'Step Into Specific' or by unchecking the option
'Step over properties and operators'.
Do you want continue being notified when an automatic step-over
happens?
What does this error message mean?
VS2017 and VS2019:
Tools > Options > Debugging > Uncheck "Step over properties and operators > (Managed only)".
It is not an error message as such. The IDE is telling you that tracing for some of your code is being skipped during debugging due to the current settings. If you want to be able to trace into the code, change the settings as described in the message.
You can change this behavior by going to: Tools -> Option -> Debugging.
The setting for this in VS2010 is under: Tools -> Option -> Debugging (near the middle)
To be more specific: the option to enable in Visual Studio 2010 is:
Tools->Options->Debugging->General->Enable property evaluation and other implicit function calls
As answered by other people this is an informational message from Visual Studio telling you that it could have stepped into a line of code but rather stepped over it due to current dev environment settings.
There are three ways to change this behaviour in VS2012:
Change the settings: Tools->Options->Debugging->General->Step over properties and operators
OR
Right click on the line of code to get the context menu. Then untick: Step over properties and operators
OR
Select 'Step into Specific' in the right click context menu which will ask you which specific function you would like to step into. It will list all the properties/functions involved in the current source line.
In Visual Studio 2013: right click on the line that caused the message to pop-up.
This will bring up the context menu.
Uncheck the option: Step over properties and operators.
Other posts have the correct answer, which state that you can change the option in Tools > Options > Debugging > Step over properties and operators (Managed only) in Visual Studio. I wanted to add an image from the Options dialog for those who are visual. Uncheck the property if you want to perform Step Into (F11) without automatic Step Over (F10).
The reason that we get this prompt is: that we may have created properties or operators in our classes, and when, during debugging, we reach that line of code, it is stepped over (like the effect of F10 ) instead of stepping into ( the actual effect of F11 )
e.g., this line of code,
having pressed F11 here, resulted into effect of pressing F10
So Visual Studio notifies us..and gives this beautiful, well illustrated message, which I could only understand when I read the following blogpost
Credits: AutoStepOver a blog post
The other answers are suffient for turning the feature on or off. Lacking is the insight as to WHY one would want to do one or the other.
For beginning C# programmers their property method is a simple {get,set}. Since this code is not worth viewing we check the box "Step over properties...".
However, when your property settings become more interesting, you may want to step into the property method to ensure it's behavior is correct. Once you tell the IDE "Don't bother me any more", then later when your "step into" fails for a complex property method, now it's your fault.
My recommendation would be either to remember how to switch the option on and off for future debugging sessions or uncheck the "Step over..." setting and learn to toggle between F11 and F10 as appropriate.
Another option is never to use "step into". Just set a breakpoint in the method/property/operator you want to debug and click the step (F10). This way you step into only the methods you are debugging.

Visual Studio F6 stopped working. It no longer builds the project

I'm using VS2008, been using it for quite some time now, and since I hate using the mouse while developing, I'm always using F6 to build the solution, or Shift+F6 to build the current project. What's weird though is for some strange reason, it simply stopped working over the last few days. In fact, when I pull down the Build menu, next to "Build MyProject" there's no longer a "Shift+F6" shortcut there on the menu?!? Anyone ever experienced this? Is there a setting I need to change?
You can change keyboard bindings in the Tools->Options dialog. It's under Environment->Keyboard.
You can reset the binding here, and also check what might have stolen it by checking what's currently bound to those keys.
If you recently installed any add-ins, they're known to set (sometimes unwanted) keyboard shortcuts.
Your Keyboard Mapping Scheme has changed.
Go to Tools -> Options. In Environments->Keyboard in the dropdown for "Apply the following additional mapping scheme" select "Visual C# 2005"
Have you tried : Tools -> Options -> Environment -> Keyboard
All the keyboard shortcuts have been shown there.
I'll add the proverbial "Is it plugged into the wall" question:
Do you have a fancy keyboard that replaces function keys with other things toggled incorrectly?
VMWare stole my Shift + F6. Maybe that's your prob?
I fixed this by going to going to tool-options-environment-keyboard just like the other suggestions but I clicked "Reset" instead to restore the proper short cuts.
Resharper was annoying about this.
I had to set BuildSolution to f6
then remove F6 from Resharper_Move
Just in case this bites anyone else: Parallels Desktop for OS X grabs F6 and uses it for "Show and hide Parallels Desktop". It can be disabled in Preferences -> OS X System Shortcuts
I know this question already has an answer but it is good to have this here for future reference:
On the Solution properties page, Configuration Properties -> Configuration, the list of projects will be displayed and the last column "Build" will have checkboxes, one for each project.
If they are all unchecked, you will press F6 but nothing will happen. Check the projects you want to build, on that case and you are now good to hit F6.

Categories