In my last post I’ve shown how to create a project template from an existing project by exporting it. Now we will go through the creation of a simple VSIX to package our project template.
Steps before creating a VSIX project
- Install the Visual Studio 2013 SDK which you can download from here.
- If you have not created a project template before, read this post.
Recently at work we had to create a lot of microservices where we required to copy-paste lot of files from one sample solution to the specific service implementations. The necessity of this approach comes from the many small differences between each service.
Of course the common code was extracted to shared libraries but this was just a partial solution. Now that we can grasp their usefulness, let’s see how to create visual studio templates!
Different options for creating templates
There are three ways to create a project template:
- Exporting a template from an existing project
- Creating a template project
- Exporting an existing project then copying its content to a template project
In this tutorial we will explore the first option.
Recently I have installed the Visual Studio 2013 SDK and encountered a very annoying error for the first time. After opening a project (any project) at the Solution explorer none of the projects were loaded. And even a more annoying error occurred when I tried to close the solution, I could not do it and was prompted with an error:
No exports were found that match the constraint: ContractName
To solve this problem I found these tips:
- Uninstall one of the extensions then restart Visual Studio. I know this sounds idiotic but a lot of people wrote this helps
- Repair the latest update for Visual Studio which worked for me. (You can found Update 4 for Visual Studio 2013 here