8

In visual studio 2010, is there a way to make snippets specific to a single project or solution? I'm interested in doing this so that I might use them to support my architectural decisions (i.e. create a POCO that implements a certain interface in a prescribed manner).

4
  • 1
    I don't know if you can or not, but my instinct says you don't need this. It implies copypasta and lack of DRY. Have you considered using T4 templates or some similar code generation process, or refactoring common methods into a static class? Commented Mar 12, 2012 at 18:25
  • 1
    I NEVER do copy paste. I'm just creating all of these POCOs for certain purposes within the application and I like to use my own templates and conventions. Plus I like to use the template pattern quite a bit. I have to type a lot of the same code over and over again. I spend too much time doing that. I started using snippet, but I find that they differ based upon the domain. I have too many snippets. It would make more sense to create them per project. I will look into the things you've suggested. Commented Mar 13, 2012 at 15:25
  • 1
    I'm talking about the structure of the POCO, not its contents. I maintain a consistent polymorphism throughout my application using interfaces for particular functions. Its very decoupled. I'm looking for something just a little bit above the "Implement Interface..." function within Visual Studio's code editor. I used to use that, but it doesn't work exactly as I'd like. Before I begin developing, I layout my POCO's in the form of snippets based upon my design docs. I'm not a college student. Commented Mar 13, 2012 at 15:30
  • For people willing to pay: Resharper has functionality with their template system (equivalent to snippets) for adding project/solution specific templates. I suspect other refactoring tools like coderush and justcode also has it Commented Dec 2, 2012 at 15:38

1 Answer 1

3

Even in VS 2013, this is not possible. Snippets are global in Visual Studio.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.