views:

214

answers:

1

Programming is (so far) just a hobby for me, so I try to find ways to improve, learn some basic algorithms and programming skills that might come in handy in the future. Currently I'm working my way though Project Euler and solving the puzzles there.

I'm working in C#, and have set up a solution named ProjecEuler in which I add one new Console Application Project for each problem. (I know, maybe not the ultimate setup considering memory efficiency and such, but it's easy to do and easy to run, and I'm only doing this for myself...)

However, as the problems became more complex, I found myself reusing the same code over and over time, so I added a ClassLibrary project in which I put useful code that I might want in several projects. But each time I add a new project to the solution, I have to manually add a reference to the class library. As I add a couple of projects per work hour on this, it gets quite tedious.

Is there any way to tell Visual Studio that I want all the projects in the solution to inherit the class library, and have VS add the references automagically?

+1  A: 

Yes. You can create a console project, add all refereces you need and then export it (File > Export Template) as a Project Template. After this, your project template will be available in Visual Studio.

This VS feature is really useful, you can customize many aspects of you template. I ecourage you spend some time playing with that!

Hope this helps!

Eduardo Cobuci