Search code examples
c#visual-studiocode-snippets

Common Code Snippet Location


I have multiple VS's installed (2012, 2013, 2015). I create custom snippets but they remain in specified version's locations like %USERPROFILE%\MyDocuments\Visual Studio 2012\Code Snippets\Visual C#\My Code Snippets.

Is it possible that I create a common location and all versions pick snippets from there. In that case it will be easy to maintain (add/update/remove) them and any change will affect all the versions.

Is it Possible?


Solution

  • Too eager to hit press "Ask Question" button.

    Here are the steps: Create a common folder and in it hierarchy like this

    > FooBar
      > C#
      > VB.Net
      .
      .
      .
      .
      .
    

    Now, in VS go to Tools > Code Snippet Manager and select Language from drop down and click on Add... and select corresponding language folder from above hierarchy. Same for other languages and you are done.

    This is a one time exercise and you are set.