Missing snippet in Visual Studio
Asked Answered
P

6

10

I have the same installation of Visual Studio on two machines, but on one, I can't find the snippet "propdp" for DependencyProperty. I only have prop/propg, can't really understand why. Is there an addon I have to install?

Paraffinic answered 18/3, 2011 at 8:1 Comment(1)
I am not sure about the exact problem, but I faced an issue with Visual studio that has occurred after installing a certain software. The quickest resolution was to reinstall Visual Studio.Bonnett
M
12

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

  1. Go to Tools > Code Snippets Manager
  2. Select Visual C# from the drop down menu
  3. Click Add
  4. 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.

Mayemayeda answered 31/3, 2011 at 12:3 Comment(1)
Thanks. On my installation it was C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC#\Snippets\1033\NetFX30, although it's an 64-bit version. Just search for the file "propdp.snippet" on your diskCarnivorous
I
10

I think ReSharper hides some of the default snippets. It should be enough to enter the snippet and press tab twice.

Illegal answered 11/7, 2012 at 12:53 Comment(1)
This was exactly my case as well in VS 2015 w/ R#10. I already had the NetFx30 listed as a source of snippets. Typing, I would only see "prop" and "propg". I had to type "propa", hit escape (to cancel Intellisense, since pressing tab would complete what was currently at the top of the Intellisense list), then hit tab twice. Thanks much!Bathyal
C
2

In my case, the snippet showed up in IntelliSense but nothing worked on selecting it and pressing enter or clicking on it, until I pressed tab+tab then it work. (I guess I was used to CodeRush).

Cavite answered 26/6, 2012 at 17:34 Comment(1)
this is true and still relevant, although in my case is the other way around. Intellisense is hidden but the snippet is there.Arbitration
D
0

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://mcmap.net/q/1161733/-code-snippets-are-missing-vs-2015 (thanks be given to "elmonopascual")

Doyle answered 5/7, 2016 at 17:13 Comment(0)
R
0

I'm using VS2017 and had the same problem. The only thing that worked for me was:

  1. Go to Tools > Code Snippets Manager
  2. Select CSharp from the dropdown menu
  3. Remove all folders in the listview (save the complete path of them for later steps)
  4. Hit OK
  5. Reopen the Code Snippets Manager
  6. Select CSharp from the dropdown menu
  7. 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.

Richela answered 28/5, 2017 at 22:58 Comment(0)
S
0

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.

Seidler answered 14/1, 2018 at 23:36 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.