问题
Same installation of Visual studio on two machines, but in 1 i cant find the snippet "propdp" for DependencyProperty ? I only have prop/propg, cant really understand why. Is there an addon i have to install?
回答1:
Came across this same issue myself today after a fresh install of VS2008 on Win7 64
All I had to do to fix it was to
- Go to Tools > Code Snippets Manager
- Select Visual C# from the drop down menu
- Click Add
Select the NetFx30 directory containing the code snippets, in my case it was...
C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC#\Snippets\1033\NetFX30
You should immediately be able to use the code snippet.
回答2:
I think Resharper hides some of the default snippets. It should be enought to enter the snippet and press two time tab.
回答3:
this may help someone in the near fututre...in my case the snipped showed on intellisense but nothing worked on selecting it and pressing enter or click on it until I clicked tab+tab then it work. Good luck!. (i guess i was used to coderush)
回答4:
Just in case anybody have this problem and the previous answer didn't fix it, if you have two folders inside C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC#\Snippets: 1033 and 3082. Copy and paste the whole content from one to the other and started to work.
Trying to import didn't fix it for me but maybe I didn't do it right... don't know...
I found it here: https://stackoverflow.com/a/36829804/5761877 (thanks be given to "elmonopascual")
回答5:
I'm using VS2017 and had the same problem. The only thing that worked for me was:
- Go to Tools > Code Snippets Manager
- Select CSharp from the dropdown menu
- Remove all folders in the listview (save the complete path of them for later steps)
- Hit OK
- Reopen the Code Snippets Manager
- Select CSharp from the dropdown menu
- Insert all the folders again with the Add button.
If I don't close and reopen the Manager before add the folders again, the VS2017 will crash and restart when I hit OK, and the snippets still won't work.
回答6:
in my case i went to tools -> Code Snippet Manager, i realized that the path to the snippet i wanted has changed. So when the Path has changed the Snippet folder will be shown with an error. So i copied the Path and followed until i found out where it was missing. Then i browsed all the folders until i located snippet i wanted and my issue was solved.
来源:https://stackoverflow.com/questions/5349402/missing-snippet-in-visual-studio