Visual Studio Options Pages

Configure visual studio addins

Published on Friday, February 15, 2008

Like many addin developers I create options pages in visual studio to handle configuration of my software.  While extremely simple to create these pages, it is not obvious how they should be configured to load with visual studio.  Additionally, the documentation for creating options pages provided by Microsoft describes in detail how to create options pages, though neglects to describe how to make visual studio recognize your options page control.

Fortunately this is extremly simple to wire up.

<?xml version="1.0" encoding="utf-16" standalone="no"?>
<extensibility xmlns="<a href="" mce_href=""></a>">
    <name>Microsoft Visual Studio</name>
    <name>Microsoft Visual Studio</name>
    <description>.netSavant is a powerful code generator for the .net framework and Visual Studio.NET.  For more information please visit <a href="" mce_href=""></a> </description>
    <aboutBoxDetails>For more information about .netSavant please visit <a href="" mce_href=""></a> </aboutBoxDetails>
    <assembly>Path to .netSavant assembly</assembly>
    <category Name="DotNetSavant">
      <subCategory Name="Adapter Generation">
        <assembly>Path to .netSavant assembly</assembly>

You'll notice that I added a ToolsOptionPage node under the root Extensibility node of a standard .addin xml file.  Here you can identify hierarchal categories that will be displayed as visual studio options pages.In this example I've added a top level options page called "DotNetSavant" with a sub category named "Adapter Generation".  Similar to the addin node of the base .addin file, both Category and SubCategory nodes can specify a single Assembly and FullClassName node.  Set the assembly nodes' inner text to the path of the assembly where your options pages control exists and then specify the fully qualified name of your options pages class in the FullClassName node and your options pages will load with visual studio.