开发者

Missing snippet in Visual Studio

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


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.


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


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).


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")


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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜