Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member
If you've been following along in this chapter, you probably have ideas for building your own add-ins and custom tools for Visual Studio. How do you distribute those to other developers? The best way is to use a special installer, known as V-S-I-X, or VSIX. You can use a VSIX installer to install many Visual Studio editions, including projects and item templates, ToolBox controls, .NET assemblies, and even custom start pages. A VSIX is nothing more than a compressed file that contains your compiled code and some special files: a content type XML file and a VSIX manifest.
Let me show you how to create a VSIX installer. I have a Solution called CustomVSIXInstaller opened, which has a project in it called LyndaCustomBizTemplate. So this thing that I'm going to install today is a project template. You might remember from earlier movies that you can export your own templates by going to File > Export. You're going to choose to export a Project template. And then here, we're going to give this template a little bit of a more interesting description, like that.
I don't want to automatically import this template into Visual Studio, so I'm going to uncheck that check box. And I will want it to show the output files folder when I'm done. Now, you can see I have a file from my previous runthrough. So I'll click on Yes to delete it, and here is that custom ZIP file. This contains the ZIP information for the custom template. Now I'm going to create the custom VSIX installer. I'll go over to my solution, right- click, and choose Add > New Project.
I'm going to go to the C# section, then to Extensibility, and then to the VSIX Project. And I'm going to call mine lyndaBizTemplateInstaller and then click OK. At this point, it's a simple matter of filling out some details--whatever I want to call my Product. And then I'm going to come down here, and this is the content that I'm going to install.
So, I'm going to click on the Add Content. Here, I get to pick the kind of installer I'm making. Project Template's what I'm working with, but you can see there's also VS Packages, there's Custom Extension Types, there is the MEF Components from an earlier demo, and here is the Toolbox Control. Today, I'm going to Project Template, and then I'll come down here and choose that ZIP file that I just saved out. So, I'm going to go over here and copy this file path, return back to Visual Studio and paste it in here. I'll paste it in here.
It'll be more useful if I paste it in here. And there is my ZIP file and then I click on Open. One more thing: I need to type in a subfolder here. I don't need to, but I'm going to have this customize the Open Project window by doing this, and I'll click on OK. Next, I need to save my project and build or rebuild my solution. At this point, I can go out to my installer, right-click, and choose Open Folder in Windows Explorer, and then drill down into the bin > Debug folder, and here is the custom installer.
Now, I will give this installer to other developers. They will take it, and they'll double-click on it. It shows information about what they're installing, the Lynda Business template. Now, I didn't put in a licensing term. Now I'm going to click the Install button and then Close. It's told me I needed to restart Visual Studio, but I could relaunch a second copy, which is what I'm going to do.
And then I'm going to go to File > New Project, and there is the lynda folder, and there's our lyndaCustomBizTemplate. Now, I'm going to choose this one and click OK, and now I have my custom files all loaded in from that CustomBizTemplate. There's one more thing you can do with this template, is you can go out to this site, the Visual Studio Gallery, and click on Upload, tell them what kind of item you're uploading, give them the path to your template, and then it'll be shared with all the other Visual Studio 2010 users when they go to the Tools > Extension Manager.
It'll show up as an item they can install from this location. Now you know how to create a custom add- in and a custom installer to share your new tool with the .NET community. I can tell you from past experience that this way of doing extensions is far superior to the old model.
Get unlimited access to all courses for just $25/month.Become a member
82 Video lessons · 101038 Viewers
61 Video lessons · 87827 Viewers
71 Video lessons · 71703 Viewers
56 Video lessons · 103586 Viewers
Access exercise files from a button right under the course name.
Search within course videos and transcripts, and jump right to the results.
Remove icons showing you already watched videos if you want to start over.
Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.
Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.
Your file was successfully uploaded.