Project, project, project, creating multi-project Solutions
- Posted: Mar 16, 2015 at 6:00AM
- 2 comments
Loading user information from Channel 9
Something went wrong getting user information from Channel 9
Loading user information from MSDN
Something went wrong getting user information from MSDN
Loading Visual Studio Achievements
Something went wrong getting the Visual Studio Achievements
No extension today, sorry. When I saw this tip, while it's not code, I knew I had to share it.
I don't know about you, but when I spin up a new project, I usually use a common pattern for my projects, different layers, etc., also using a common set of libraries.
One of the great Visual Studio time savers are project templates. You've use them all the time, every time you File, New, Project. Did you can create your own project templates? You can take one of your existing projects and make it a template? How to: Create Project Templates
After a while of creating the same solution structure code over and over again for the some kinds of projects I decided to make a template. Making a single project template was easy: you just follow along the Visual Studio export template wizard but making a solution template with multiple projects was not as simple, hence the reason for this blog post.
I’m using a PC with Windows 8.1 Pro and Visual Studio 2013 with update 4.
First set up a solution with the projects you want to make into a template. For this example I’ll go with a really simple and stripped down skeleton for a backend solution following the domain driven design. You can fork it here. It’s just a really simple skeleton solution with multiple projects, feel free to go wild and crazy adding stuff and altering it as you like for your template.
This is what my demo project structure looks like
In order to make this into a Visual Studio template we need a .vstemplate file in the root as well as in each project we want to include in the final solution template. The easiest way is to use the template export wizard to export the projects one by one and then add the root template.
Export each project
Go to File ➜ Export Template…
[Click through to read the complete tutorial, Visual Studio: How to create a solution template with multiple projects]
For more information on creating Project and Item templates, check out Creating Visual Studio Templates.