I did a fresh install of Visual Studio 2022 v17.0.0 (.NET 6.0) and created a new WebAssembly project. Tried editing Counter component but none of the snippets work for C#.
Typing cw is supposed to bring up Console.WriteLine but nothing happens, tabbing does nothing but insert tabs. Tried several other snippets and same results. If I enter Console. I should get suggestions popping up but I get nothing.
I tried doing a repair installation but didn't fix the problem. Any suggestions as to what else I can try to fix. Thanks
Most likley it is functioning but I found that VS 2022 made som changes to the default behaviour.
Make sure that when you type your phrase in the the document that it is appearing on top of the suggestion box.
Example showing suggestion
If not press ctrl + alt + space. Try again.
Example not showing suggestion
If you are experiencing that the phrase you are typing is not default selected when you try to tab out your snippet you may want to change your IntelliSense behaviour from 'Include snippets when ?- Tab....' to 'Always include snippets'.
Tools > Options > Text Editor > C# > IntelliSense > 'Always include snippets'
Best of luck, fingers crossed, godspeed and all that. =)
Go to tools/options/texteditor/advanced and check that default intellisense completion mode is automatic.
Then I have the cw snippet appearing, and it is inserted after typing twice tab:
With ctrl+k, ctrl+b check that your snippets are present; if there is a problem here, you may have a problem with your snippet file.
Other remarks:
Do not log in as user as it may rewrite you parameters.
If a repair does not work, deinstalling then installing again VS will give a cleaner install.
I had the same problem but managed to get things working again. In the Code Snippets Manager (CTRL + K CTRL + B) I noticed my snippets folder had the same name as another folder ("Visual C#"). I removed my folder from Code Snippets Manager, renamed it in File Explorer to be unique when in the Code Snippets Manager, then added it back in to Code Snippets Manager.
I then had to restart my Visual Studio 2022 before it recognised my snippets.
Following that, it seems I can edit my snippets without having to restart VS. I'd say VS 2022 has a problem with the initial recognition of the custom snippets folder.
If you re-add the snippets and restart Visual Studio it works.
In my case, if I copied the folder in the picture and opened in explorer it seems like the folder doesn't exist. But if I press "Add" and navigate to this folder it does exist and I can add the default snippets again.
For me only enabling Always include snippets didn't work. With the Visual Studio 2022, Version 17.4.3 I had to disable the Show new snippet experience (experimental) option in the Tools->Options->Text Editor->IntelliSense. There is no need to restart VS.
Related
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.
My Visual Studio (2008) Editor has stopped to underline Errors (this nifty wavy red lines). I can't really tell when, but it can be related to the installation of .Net Framework 3.5 SP 1 or the MVC Beta (which I guess is unlikely). Furthermore have I installed and uninstalled both CodeRush and Resharper for evaluation purposes (decided not to keep either one of them).
Does anyone know the problem and how to restore this functionality again?
Have you checked Tools→Options...→Text Editor→C#→Advanced→Underline errors in the editor?
I usually like to reset my settings after messing around with plugins, as they tend to mess with settings: Tools→Import and Export Settings...→Reset all settings.
About possible causes.
For VS 2012 and 2013 if you have more than one instance of Visual Studio on different machines binded to one "live" account and have installed ReSharper on one of them, it disables the native IntelliSense and error underlines (to replace by it's own rules) that will be synchronised through your account to another machine without ReSharper.
Found it in Visual Studio 2019 as: Tools > Options > Text Editor > General > Show error squiggles
This is generally called Disable Squiggly or Wavy lines in Visual Studio.
How you will do in Visual studio 2013?
TOOLS -> Options... -> Text Editor -> C/C++ -> Advanced -> Disable Squiggles: True/False (Under IntelliSense) -> Press OK
I know its an old question, and with various solutions, but I have fixed it in different way. I'm working with Unity3D on my C# code using VS2017, when suddenly VS decides to stop underlining error while im typing. However, if I close the file tab and reopen, it suddenly undelines the error.
For example:
class A {
public int x;
s;
}
should obvsiouly give an error for that lonely 's' symbol. But, VS doesn't underline it until I close and reopen this file tab.
Solution:
Copied the entire Unity Project folder (which is like a regular VS Solution folder basically) and worked with the new folder, which issue was gone there.
For visual studio 2017 act according to HeeJae's comments in:
https://developercommunity.visualstudio.com/content/problem/113112/design-time-error-checking-isnt-working.html
i.e:
Hi. you are probably hitting a known issue. can you try this?
1.Update to latest release If that doesn’t solve it
2.Go to Tools\Options\Projects and Solutions\General and uncheck “Allow parallel project initialization”.
3.Close VS.
4.Delete the “.vs” directory beside their solution file.
5.Reopen VS.
..
thank you
You can re-enable the "Allow parallel project initialization" option after the issue was solved.
I tried to upgrade VS, reset VS settings, clear VS cache and everything people do conventionally but none of them solved this issue! At the end the mentioned solution worked for me magically.
Good luck
Unloading and loading same project again from the solution does the trick. Just right click on the project and click "Unload Project". Once unloaded, again right click the same project and click "Reload Project". Error highlighting will return.
I had the same issue with 2017. There was a 'disable intelisense' option, make sure that is set to false.
For everyone wondering in 2021..
search for "C_Cpp.errorSquiggles" in the settings.
Make sure to have it active for the user, as well as the workspace.
No need to restart Visual Studio.
For me (VS 2019) , after trying the other answers also, setting the scope of analysis from "Current document" to Open document" brought back the missing error markers
Just go to settings and search for errors and Image in Error Squiggles. You can see the Error squiggles (Modified: Workspace - Right now you can't see it because I modified it). Just click on modified and you will see the disabled option. If by mistake you disabled it, just enable it and you can see the red line errors again in your code.
In latest edition, check for .vscode folder in same project folder. There will be a setting.json file in that. Delete the key value pair of "C_Cpp.errorSquiggles": "Disabled". Restart the vs code.
I've installed Visual Studio 2012 after reformatting my computer.
When I open a xaml file in a new empty wpf project, it opens it in a regular code editor and doesn't let me choose Design View (the option is just not there).
Right-clicking the xaml file and choosing "View Designer" opens a new code window instead of a new designer window. (yes, the same code window is actually opened twice)
Right-clicking the xaml file and choosing "Open With" shows that I'm missing the Xaml UI designer editor. (it doesn't show anywhere on the list)
I've tried running "devenv.exe /ResetSkipPkgs" and "devenv.exe /resetuserdata" and Repairing visual studio's installation all together (both by re-installing and the Repair button in the installation wizard).
Nothing seems to help.
Anyone familiar with the problem and knows how to fix?
Something else to try, I know a lot of folks disable the designer for performance reasons. This is done with a file extension association in visual studio. I'm wondering if the reverse may help you?
If you right click a XAML file in your solution and select Open with...
... You should see XAML UI designer as an option! select it and click 'Set as default'.
Hopefully that works for you.
I am just guessing, but my experience with VS2012 is, that sometimes it cannot access the registry, because it fails to set an owner for the newly created registry keys.
Without owner noone but the System can access those Keys.
I used resplendence Registrar Registry Editor Trial Version to Fix the broken Keys.
I would especially check
HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\11.0
and
HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\11.0\XamlEditor
because you can find all the settings there.
In addition i experienced this error only on recently reformatted win 7 systems.
And all of them have ssd's, but i am not sure if it only occurs on systems where no "old" harddrive is. But i found some people on msdn who also experienced issues whith VS2012 and having only a ssd in the system.
Just recently, my Visual Studio 2010 stopped displaying IntelliSense suggestions automatically while I am typing. I can still press ctrl+space to get it to work, but it doesn't automatically show a list of suggestions like it used to. I have already tried disabling all my extensions, restarting VS and the computer, and I have checked all the appropriate settings (Options -> Text Editor -> C# -> IntelliSense) to make sure that it is set to offer suggestions after a character is typed.
Has anyone seen this behavior before? Does anyone have any other suggestions for how I can get IntelliSense to go back to the way things were before? If not, I might just have to do a fresh reinstall of VS...
In prose, in case you can't see the above image:
Open Tools > Options > Text Editor. If you're only having this issue with one language, find that language; if it's for everything, click "All Languages". Right at the top, there'll be a few options labeled "Auto list members", "Hide advanced members", and "Parameter information". Make sure all of those are enabled (though the second may be disabled; if so, ignore it).
I have found that at times even verifying the settings under Options --> Statement Completion (the answer above) doesn't work. In this case, saving and restarting Visual Studio will re-enable Intellisense.
Finally, this link has a list of other ways to troubleshoot Intellisense, broken down by language (for more specific errors).
http://msdn.microsoft.com/en-us/library/vstudio/ecfczya1(v=vs.100).aspx
I'll start off my noting that this hasn't happened since I upgraded my RAM. I was at 4GB and would often have multiple instances of VS open along with SSMS. I have since gone to 8GB and then 16GB.
Here's the steps I go through when I lose intellisense.
If only one file/window appears to be affected, close/reopen that file. If that doesn't work, try below.
In Visual Studio:
Click Tools->Options->Text Editor->All Languages->General
Uncheck "Auto list members"
Uncheck "Parameter information"
Check "Auto list members" (yes, the one you just unchecked)
Check "Parameter information" (again, the one you just unchecked)
Click OK
If this doesn't work, here's a few more steps to try:
Close all VS documents and reopen
If still not working, close/reopen solution
If still not working, restart VS.
For C++ projects:
MSDN has a few things to try: MSDN suggestions
The corrupt .ncb file seems most likely.
From MSDN:
Close the solution.
Delete the .ncb file.
Reopen the solution. (This creates a new .ncb file.)
Notes:
This issue does not appear to be specific to C# as C++ and VB users
report the same issue
Tested in VS 2013/2015
Steps to fix are:
Tools
Import and Export Settings
Reset all settings
Back up your config
Select your environment settings and finish
I also faced the same issue but in VS2013.
I did the below way to fix, It was worked fine.
Close all the opened Visual studio instance.
Then, go to "Developer command prompt" from visual studio tools,
Type it as devenv.exe /resetuserdata
Restart the machine, Open the Visual studio then It will ask you to choose the development settings from initial onwards, thereafter open any solution/project. You'll be amazed.
Hope, it might helps you :)
Deleted the .suo file in solution folder to solve the problem.
Sometimes i've found Intellisense to be slow. Hit the . and wait for a minute and see if it appears after a delay. If so, then I believe there may be a cache that can be deleted to get it to rescan.
I hit this today after the following sequence:
Added a new class to my project.
Closed Visual Studio, but accidentally selected No when it asked if I wanted to save changes.
Reopened Visual Studio, and found that it reopened the new file automatically but without my previous changes (as expected). However, IntelliSense was no longer working in the new file.
The problem was in addition to not saving changes to the new file, it didn't save changes to the project, so after reopening Visual Studio the file was not part of the project. The Show All Files command in Solution Explorer, or Add → Existing Item..., resolved the problem.
I had the file excluded from the project so i was not able to debug and have intellisense on that file.
Including the file back into the project solved my problem! :)
A new cause for this in the .net core era is having a project loaded for an unsupported .net core version. For instance if you loaded a project from GitHub that was set to use:
<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
<AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel>
</PropertyGroup>
But you only have 2.1 installed or find yourself using Visual Studio 2017 then the compiler wont be able to find the SDK code and thus provide intellisense.
The solution in that case might be to right click on your project and select Edit MyProject.csproj from the context menu and change the target framework as necessary:
<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>
<AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel>
</PropertyGroup>
This assumes whatever project you loaded can actually be run under a lesser target framework.
I simply closed all pages of visual studio and reopened ..it worked.
Deleting the .vs folder in the solution solved my issue. You have to exit from Visual Studio and then delete the .vs folder and start Visual Studio again.
Closed all my VS windows
Started the Visual Studio Installer and clicked 'Modify'.
Under 'Individual components' > 'Code Tools' > Deselected NuGet package manager and re-selected it.
After modifying and restarting VS, IntelliSense was working correctly again.
Found my answer on https://developercommunity.visualstudio.com/content/problem/130597/unity-intellisense-not-working-after-creating-new-1.html
[Tools -> Options -> Text Editor -> All Languages -> CodeLens]
Check if check box "Enable CodeLens" is checked
I have just come to about this problem while installing one of the extensions and its file was deleted by my anti virus so I just disabled my anti virus and reinstalled visual studio. Suggestions are working properly without any changes made after installation.
At the bottommost right look at the blue line where Ln, Col, Spaces, UTF, CRLF,..... here the language is specified.
Check that your language and the language specified there are the same.
In my case, it was Django Python while I was trying to use HTML.
This may be due to the solution configuration changed to Release Mode instead of debug. Right click on solution -> Properties -> Configuration Properties -> Set Configuration To Debug if it is in Release.
I'm attempting to use the Ctrl+R, Ctrl+R command within Visual Studio 2008 to rename a variable. I get an error message at the bottom saying that
"The key combination (Ctrl+R, Ctrl+R) is bound to command (&Rename...) which is not currently available."
I am not running it or anything I can think of which might prohibit modifications of the file and the F2 command allows a rename to happen. Anyone know how to fix this?
EDIT: I do have Resharper installed but was previously able to do this with the same setup, I recently migrated computers.
I was able to fix this by doing the following:
Go to Resharper → Options menu commmand
Select Environment → Keyboard & Menus
Select the Visual Studio option under Keyboard Shortcuts
Click Apply Scheme and Save
This will cause Ctrl+R, Ctrl+R to do a rename. (Select ReSharper options in the dialog box that pops up then.)
However, it made F2 no longer able to preform a rename. I was able to fix that by doing the following:
Go to ReSharper → Options menu command
Select Environment → General
Select the ReSharper 2.x or IntelliJ IDEA under Restore ReSharper keyboard shortcuts
Click Apply or OK
This allows both F2 and Ctrl+R, Ctrl+R commands to work for renaming a variable.
This seems to be specific to ReSharper being installed with Visual Studio, I don't know what the solution would be to fix this if ReSharper weren't installed.
For Resharper 6
You should:
Select menu "Resharper" - "Options..."
Select "Visual Studio Integration"
Choose "Visual Studio" in both places
Click "Apply Scheme"
It will either works or you will have a selection to do (Visual Studio or Resharper), if it is so, then choose Resharper.
resharper has multiple default shortcut bindings that is chosen the first time you start visual studio after instalation. My guess is you picked a different one this time.
In my case the problem was solved by clearing the ReSharper cache. This can be done in the options menu under Environment > General here:
This happened to me once. I had to reinstall Resharper (repair from Add/Remove programs probably) to get it to work. But that was with VS2005 though.
Using version 8 of ReSharper in Visual Studio 2013, I had to
Go to the RESHARPER menu -> Options
Expand Environment
Select Keyboard & Menus
Choose Visual Studio as the ReSharper keyboard scheme
Click Apply Scheme...Save & close dialog box.
The next time I executed a keyboard shortcut it prompted me to choose which keyboard shortcut I wanted to use.
Nothing has worked for me until I have tried upgrading my Resharper! :O
I'm guessing very few people will be in my situation but FWIW I was in this situation too where Refactor.Rename (Ctrl+R,Ctrl+R) was NOT working in Visual Studio 2019/Win 10, after reboots/restarts plus I did not have Resharper installed. In my case Refactor.Rename wasn't working because my project was in FOLDER mode not SOLUTION mode (OMFG). Soon as I used the solution tool to "Switch Views" and went into SOLUTION mode Refactor.Rename started working again. In hindsight this makes sense of course but some kind of error message/warning would have been nice to help me realize what the issue was!
For me, the issue was I hadn't started the Resharper evaluation which wasn't obvious because all of the Resharper extension options were accessible, but the clue was under:
Extensions -> Resharper -> Why Resharper Is Disabled.
Click "Start Evaluation" (in the same location as "Pause Evaluation" in the screenprint)
I expected the evaluation to start when I clicked "OK", but clearly it doesn't.
You get this behaviour in Visual Studio (without R# installed) if the editor window does not have focus when you issue the shortcut. I've just tried it with R# installed and it does the same thing.
Give the editor focus (ie. by clicking in it) and try again.
This is usually the shortcut used by Resharper. Is there any chance Resharper is not running?
Alternatively, you can change the name, hit Ctrl+. and then use Rename.
For DevExpress:
Open the Options screen (Ctrl+Alt+Shift+O)
Go to Core → Features
Set Default to Visual Studio shortcuts
For me, this problem was caused by me not clicking 'Accept" on the terms and conditions page, but closing it. I did not realize it was the terms and conditions, and thought it was just a notice, or a 'readme' being displayed.
All the answers above are well and good but this error also comes up in one more instance.
You start debugging your test script written for the project , the project stops at breakpoint .
If at this point , you try any operation on code , you will get the error similar to :
"The key combination (Ctrl+R, Ctrl+R) is bound to command (&Rename...) which is not currently available."
Restart Visual Studio.
Worked for me.
None of the above worked for me. I had to reset my resharper settings in the end.
Go to Resharper -> Manage Options
Click the "Reset All Settings" button
In my case (Visual Studio 2022 17.4.0 with Resharper 2022.2.2), I had to
disable Resharper
restart Visual Studio to make the change effective
enable Resharper
restart Visual Studio to make the change effective