amateur
amateur

Reputation: 44605

how to setup templates in visual studio

I am working with Visual Studio 2012 and I would like to create some templates ie. when I create a new C# class, javascript file etc I would like a custom template in place so that it has the standard company copyright header, layout etc.

I have done this before as part of ItemTemplates and ProjectTemplates within VS, but it gets kinda messy. Is there an easier way of doing this?

I work with resharper within VS, so any way this could ease the process.

I would also like to do similar for SQL Management Studio, I am presuming the template process is similar.

Upvotes: 1

Views: 381

Answers (1)

Pavel Bakshy
Pavel Bakshy

Reputation: 7747

You can setup file header text in resharper options: Resharper -> Options -> Code Editing -> File Header Text. After this create formater or edit existing in Resharper -> Options -> Code Editing -> Code Cleanup and enable there option update file header. So if you run formater after that, it will add the header. To run formater you can use Ctrl + Alt + F. Additionaly formater reformat your code according to code style configuration. You can read more about this here.
But unfortunately I don't know is there a way to share this with SQL Management Studio.

Upvotes: 1

Related Questions