<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="https://www.w3.org/2005/Atom" xmlns:sy="https://purl.org/rss/1.0/modules/syndication/" xmlns:dc="https://purl.org/dc/elements/1.1/" xmlns:content="https://purl.org/rss/1.0/modules/content/" xmlns:wfw="https://wellformedweb.org/CommentAPI/" xmlns:slash="https://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>VSX Arcana</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/vsx/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/vsx/feed.xml</link>
    <description>Covering the many topics of Visual Studio Extensibility</description>
    <lastBuildDate>Wed, 17 Apr 2019 03:27:31 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>Creating a VSIX Deployable C++ project template.</title>
      <link>https://docs.microsoft.com/archive/blogs/vsx/creating-a-vsix-deployable-c-project-template</link>
      <pubDate>Thu, 04 Jan 2018 22:21:43 GMT</pubDate>
      <dc:creator><![CDATA[Ed Dore]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/vsx/?p=275</guid>
      <description><![CDATA[The problem:
Recently I had a customer inquire about an issue they had encountered with a custom...]]></description>
      <content:encoded><![CDATA[<h1>The problem:</h1>
Recently I had a customer inquire about an issue they had encountered with a custom C++ project template they had created. Using a
vstemplate based project template, they were able to successfully create a C++ project, but noticed a discrepancy in the project’s General Property Page. Specifically, the “Target Platform”, and “Windows SDK Version” settings appeared to be incorrect. For example:

<a href="https://msdnshared.blob.core.windows.net/media/2018/01/ProjectProperties.png"><img width="473" height="324" title="ProjectProperties" alt="ProjectProperties" src="https://msdnshared.blob.core.windows.net/media/2018/01/ProjectProperties_thumb.png" border="0" /></a>

Whereas, if they created a new C++ DLL project using the standard  DLL template that comes with Visual Studio:

<a href="https://msdnshared.blob.core.windows.net/media/2018/01/NewStockDllProject.png"><img width="510" height="257" title="NewStockDllProject" alt="NewStockDllProject" src="https://msdnshared.blob.core.windows.net/media/2018/01/NewStockDllProject_thumb.png" border="0" /></a>

The resulting projects “Target Platform” and “Windows SDK Version” were set to:

<a href="https://msdnshared.blob.core.windows.net/media/2018/01/ProjectProperties2.png"><img width="472" height="324" title="ProjectProperties2" alt="ProjectProperties2" src="https://msdnshared.blob.core.windows.net/media/2018/01/ProjectProperties2_thumb.png" border="0" /></a>

Typically, whenever I see issues like these, the first thing I do is compare the .vcxproj files to see what might be different. And sure enough, the .vcxproj generated by the standard template included the following:
<pre style="background: white;width: 966px;height: 210px;color: black;font-family: consolas"><span style="font-family: Courier New"><span style="font-size: xx-small"><span style="color: blue">  &lt;</span><span>PropertyGroup</span><span style="color: blue"> </span><span style="color: red">Label</span><span style="color: blue">=</span>"<span style="color: blue">Globals</span>"<span style="color: blue">&gt;</span>
<span style="color: blue">    &lt;</span><span>VCProjectVersion</span><span style="color: blue">&gt;</span>15.0<span style="color: blue">&lt;/</span><span>VCProjectVersion</span><span style="color: blue">&gt;</span>
<span style="color: blue">    &lt;</span><span>ProjectGuid</span><span style="color: blue">&gt;</span>{C56BA256-602E-4F31-AC6D-8453D7BFBCB3}<span style="color: blue">&lt;/</span><span>ProjectGuid</span><span style="color: blue">&gt;</span>
<span style="color: blue">    &lt;</span><span>Keyword</span><span style="color: blue">&gt;</span>Win32Proj<span style="color: blue">&lt;/</span><span>Keyword</span><span style="color: blue">&gt;</span>
<span style="color: blue">    &lt;</span><span>RootNamespace</span><span style="color: blue">&gt;</span>MyStandardDLLProject<span style="color: blue">&lt;/</span><span>RootNamespace</span><span style="color: blue">&gt;</span>
<span style="color: blue">    <strong>&lt;</strong></span><strong>WindowsTargetPlatformVersion<span style="color: blue">&gt;</span>10.0.16299.0<span style="color: blue">&lt;/</span>WindowsTargetPlatformVersion<span style="color: blue">&gt;</span></strong>
<span style="color: blue">  &lt;/</span><span>PropertyGroup</span><span style="color: blue">&gt;</span></span></span></pre>
<p class="MsoNormal" style="margin: 0in 0in 0pt;line-height: normal">To confirm, I removed the above &lt;WindowsTargetPlatformVersion&gt; tag from the .vcxproj, reloaded the project, and observed, the “Target Platform” and “Windows SDK Version” settings changed to “Windows” and “8.1” respectively. So it was pretty obvious the culprit was a missing &lt;WindowsTargetPlatformVersion&gt; entry in the .vcxproj. But upon examining the .vcxproj files used by various VC++ templates (located under the C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\VC\VCWizards directory), none of these .vcxproj files contained a &lt;WindowsTargetPlatformVersion&gt; entry.</p>
So it was pretty safe to assume this entry was programmatically added after the fact. Searching the files under “C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\VC\VCWizards” for “WindowsTargetPlatformVersion” quickly revealed the StampWindowsTargetPlatformVersion method in the “C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\VC\VCWizards\1033\common.js” file:
<pre style="background: white;color: black;font-family: consolas"><span style="font-size: xx-small"><span style="color: blue">function</span> StampWindowsTargetPlatformVersion(oProj)
{     
   <span style="color: blue">var</span> strLatestWindowsSDKVersion = GetLatestWindowsSDKVersion(oProj);
   <span style="color: blue">if</span> (strLatestWindowsSDKVersion)
   {
      </span><span style="font-size: xx-small"><span style="color: green">//Stamp the latest Windows SDK version found in the disk - It is a global property, so enough to do it for any one config
</span>      <span style="color: blue">var</span> commonConfigRule = oProj.Object.Configurations(1).Rules(<span>"ConfigurationGeneral"</span>);
      commonConfigRule.SetPropertyValue(<span>"WindowsTargetPlatformVersion"</span>, strLatestWindowsSDKVersion);
   }
}</span></pre>
And subsequently, the GetLatestWindowsSDKVersion method:
<pre style="background: white;color: black;font-family: consolas"><span style="font-size: xx-small"><span style="color: blue">function</span> GetLatestWindowsSDKVersion(oProj)
{     
   <span style="color: blue">return</span> oProj.Object.LatestTargetPlatformVersion;
}</span></pre>
<h1>The solution:</h1>
Given that we want to use .VSIX deployment and consequently a .vstemplate based template, it’s fairly obvious we’ll need to implement and associate a custom IWizard implementation to the template. To set the WindowsTargetPlatformVersion property, you can use the VCProject.LatestTargetPlatformVersion property, and the IVCRulePropertyStorage.SetPropertyValue method in an IWizard.ProjectFinishedGenerating method similar to the following:
<pre style="background: white;color: black;font-family: consolas"><span style="font-size: xx-small"><span style="color: blue">public</span> <span style="color: blue">void</span> ProjectFinishedGenerating(<span>Project</span> project)
{
   <span style="color: green">// use VCProject.LatestTargetPlatformVersion property, which is what the stock wizards use.</span>    
   <span>VCProject</span> vcProject = (<span>VCProject</span>)project.Object;    
   <span style="color: blue">string</span> wtpv = vcProject.LatestTargetPlatformVersion;    
   <span style="color: blue">if</span> (wtpv != <span style="color: blue">null</span>)    
   {
      </span><span style="font-size: xx-small"><span style="color: green">// we only have to do this for a single config, as the property in question is global.
</span>      <span>IVCCollection</span> configs = (<span>IVCCollection</span>)vcProject.Configurations;
      <span>VCConfiguration</span> firstConfig = (<span>VCConfiguration</span>)configs.Item(1);
      <span>IVCRulePropertyStorage</span> rule = (<span>IVCRulePropertyStorage</span>)firstConfig.Rules.Item(<span>"ConfigurationGeneral"</span>);
      rule?.SetPropertyValue(<span>"WindowsTargetPlatformVersion"</span>, wtpv);
   }
}</span></pre>
The final issue that needed to be addressed was a missing .vcxproj.filters file. The project template contained a SimpleDLL.vcxproj.filters file, which was also referenced as a ProjectItem in the templates .vstemplate manifest. And while I could see the SimpleDLL.vcxproj.filters file was included in the .VSIX, it wasn’t showing up along side the SimpleDLL.vcxproj. This is due to a limitation of the IDE’s project template wizard implementation. Files included via the projects’ .vstemplate manifest are copied to a temp directory when the template is first unpacked, but only the files referenced by the project file are then copied to the final destination directory. Because .vcxproj.filters files aren’t referenced in the .vcxproj file, these will need to be programmatically copied from the temp directory, to the final destination directory.  And given we already have a custom IWizard to handle setting the WindowsTargetPlatformVersion, this can be easily added to IWizard.RunStarted method similar to the following:
<pre style="background: white;color: black;font-family: consolas"><span style="font-size: xx-small"><span style="color: blue">public</span> <span style="color: blue">void</span> RunStarted(<span style="color: blue">object</span> automationObject, <span>Dictionary</span>&lt;<span style="color: blue">string</span>, <span style="color: blue">string</span>&gt; replacementsDictionary, <span>WizardRunKind</span> runKind, <span style="color: blue">object</span>[] customParams)
{
   _dte = (<span>DTE</span>)automationObject;

   </span><span style="font-size: xx-small"><span style="color: green">// manually copy over the SimpleDLL.vcxproj.filters file because it isn't
</span>   </span><span style="font-size: xx-small"><span style="color: green">// referenced by the .vcxproj, and the wizard engine doesn't copy it to
</span>   </span><span style="font-size: xx-small"><span style="color: green">// the project's destination directory.

</span>   </span><span style="font-size: xx-small"><span style="color: green">// note, customParams[0] is the full path to the .vstemplate file, so we'll
</span>   </span><span style="font-size: xx-small"><span style="color: green">// use it's folder to find the needed SimpleDLL.vcxproj.filters file.
</span>   <span style="color: blue">string</span> sourceFile = <span>Path</span>.Combine(<span>Path</span>.GetDirectoryName((<span style="color: blue">string</span>)customParams[0]), <span>"SimpleDll.vcxproj.filters"</span>);
   <span style="color: blue">string</span> destFile = <span>Path</span>.Combine(replacementsDictionary[<span>"$destinationdirectory$"</span>], <span style="color: blue">string</span>.Format(<span>"{0}.vcxproj.filters"</span>, replacementsDictionary[<span>"$projectname$"</span>]));
   <span>File</span>.Copy(sourceFile, destFile);
}</span></pre>
So there you have it. To create a VSIX deployable C++ project template, that properly sets the WindowsTargetPlatformVersion property, and includes a .vcxproj.filters file, you can implement and associate a custom IWizard assembly with your project template as described above. A working example can be found in the VSXArcana github repo at : <a href="https://github.com/EdDore/VSXArcana/tree/master/CppDLLProjectTemplate" title="https://github.com/EdDore/VSXArcana/tree/master/CppDLLProjectTemplate">https://github.com/EdDore/VSXArcana/tree/master/CppDLLProjectTemplate</a>.]]></content:encoded>
    </item>
    <item>
      <title>Debugging F1 Help Context with the Debug Help Context ToolWindow extension</title>
      <link>https://docs.microsoft.com/archive/blogs/vsx/debugging-f1-help-context-with-the-debug-help-context-toolwindow-extension</link>
      <pubDate>Tue, 19 Dec 2017 21:41:10 GMT</pubDate>
      <dc:creator><![CDATA[Ed Dore]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/vsx/?p=216</guid>
      <description><![CDATA[Every once in a while I have a need to watch what’s being pushed as the active F1 context to debug...]]></description>
      <content:encoded><![CDATA[Every once in a while I have a need to watch what’s being pushed as the active F1 context to debug or troubleshoot F1 Context Help.  The <a href="https://thirdblogfromthesun.com/2013/01/debug-visual-studio-f1-help/">Debug Help Context ToolWindow</a> is quite useful for diagnosing possible issues with your F1 help context keywords, but requires a bit of insider knowledge or bing/google super powers to dig up the magic registry key to reveal the menu item that displays the toolwindow.

With VS 2017’s changes to use a privateregistry.bin, file adding this magic registry value is even more painful.

So without further adieu, I present the<strong> <a href="https://marketplace.visualstudio.com/items?itemName=eddore.VSXArcana-ShowDebugHelpContext">“Debug Help Context” extension</a></strong>. This is a very simply extension that adds a “Show Help Context” menu item to the bottom of the IDE’s “View” menu. Invoking this menu item will display the hard to find “Debug Help Context” toolwindow.]]></content:encoded>
    </item>
    <item>
      <title>How to add a custom Paste Special command to the VS Editor menu</title>
      <link>https://docs.microsoft.com/archive/blogs/vsx/how-to-add-a-custom-paste-special-command-to-the-vs-editor-menu</link>
      <pubDate>Thu, 21 Apr 2016 21:12:25 GMT</pubDate>
      <dc:creator><![CDATA[Ed Dore]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/vsx/?p=205</guid>
      <description><![CDATA[&nbsp;

When editing code with the Visual Studio Editor, you may have come across a very useful...]]></description>
      <content:encoded><![CDATA[&nbsp;

When editing code with the Visual Studio Editor, you may have come across a very useful feature that allows for copying JSON or XML data to the clipboard, and then pasting new classes into your code based upon the structure of the data. For example, consider the following JSON data:

<code>{"employees":[
{"firstName":"John", "lastName":"Deere", "age":"25"},
{"firstName":"Karen", "lastName":"Carpenter", "age":"33"},
{"firstName":"Ronald", "lastName":"McDonald", "age":"101"}
]}</code>

If you select the above JSON text and copy it to the systems’ clipboard, and then select Visual Studio’s “Edit | Paste Special | <strong>Paste JSON as Classes</strong>” menu command, you’ll end up with a couple of nice new classes inserted into your code file, based upon the structure of the JSON data. For example:

<code>public class Rootobject
{
&nbsp;&nbsp;&nbsp;public Employee[] employees { get; set; }
}

public class Employee
{
&nbsp;&nbsp;&nbsp;public string firstName { get; set; }
&nbsp;&nbsp;&nbsp;public string lastName { get; set; }
&nbsp;&nbsp;&nbsp;public string age { get; set; }
}</code>

Seeing as how DulcineaS <a href="https://social.msdn.microsoft.com/Forums/vstudio/en-US/1d7ad22f-2c1d-43e3-9222-431784229422/paste-special-menu?forum=vsx" target="_blank">posted a question</a> about adding additional Paste Special commands to Visual Studio, I suspect a small walkthrough might be useful to others that may be contemplating adding similar customizations to the IDE. Additionally, given VS 2015 has been out for some time now, I wanted to play with the updated code spew the new VS 2015 VSIX template and Custom Command item template generated.

So without further ado, lets walk through the process of building a new custom command that pastes text as a comment, into a C# code file.
<h3>Prerequisites</h3>
<a href="https://www.microsoft.com/en-us/download/details.aspx?id=48146" target="_blank">Visual Studio 2015 Community Edition</a> or better.

Don’t forget to use the <strong>custom install</strong> option and specify the <strong>Visual Studio Extensibility Tools</strong>. If you don’t, you will need to rerun the setup, to install the extensibility tools that include the project templates and reference assemblies used in this walkthrough.
<h3>Walk Through</h3>
Those of you familiar with earlier versions of the Visual Studio SDK, take note. The VSSDK Project Templates deployed with the earlier Visual Studio SDKs were revamped for VS 2015, with some of the features turned into Item Templates. So first things first, we need a new VSIX project, to which we’ll subsequently add a custom command to.
<h4>Create a new “VSIX Project”</h4>
Think of the VSIX project as the deployment or installation package for your extension. Building this project will result in a .VSIX file that you can use to easily deploy your extension.
<ol>
	<li>Select the File | New.Project… menu item, to invoke the “Add New Project” dialog</li>
	<li>Select the “VSIX Project” template and enter a project name as highlighted below<a href="https://msdnshared.blob.core.windows.net/media/2016/04/NewVSIXProject.png"><img style="padding-top: 0px;padding-left: 0px;padding-right: 0px;border-width: 0px" title="NewVSIXProject" src="https://msdnshared.blob.core.windows.net/media/2016/04/NewVSIXProject_thumb.png" alt="NewVSIXProject" width="472" height="268" border="0" /></a></li>
	<li>Click the “OK” button to create the initial VSIX project</li>
</ol>
<h4>Add a new “Custom Command”</h4>
Now we need to add an extensibility point to our newly created VSIX Project. We want to add an additional command to the Edit | Paste Special menu item, so we should choose the “Custom Command” template as follows:
<ol>
	<li>Select the Project | Add New Item… menu item, to invoke the “Add New Item” dialog</li>
	<li>Select the “Custom Command” template and enter a filename as highlighted below<a href="https://msdnshared.blob.core.windows.net/media/2016/04/NewCustomCommand.png"><img style="padding-top: 0px;padding-left: 0px;padding-right: 0px;border-width: 0px" title="NewCustomCommand" src="https://msdnshared.blob.core.windows.net/media/2016/04/NewCustomCommand_thumb.png" alt="NewCustomCommand" width="486" height="291" border="0" /></a></li>
	<li>Select the “Add” button to add the custom command to the project</li>
</ol>
<h4>Modify the Custom Command</h4>
By default, the Item template simply adds our new command to the Tools menu, so we’ll need to modify its properties, so that it shows up on the correct menu, and displayed or hidden, depending upon whether there is any text currently copied to the clipboard.
<ol>
	<li>Open the .VSCT file (PasteAsCommentCommandPackage.vsct)</li>
	<li>Locate the following command definition
&lt;Button guid="guidPasteAsCommentCommandPackageCmdSet" id="PasteAsCommentCommandId" priority="0x0100" type="Button"&gt;
&nbsp;&nbsp;&nbsp;&lt;Parent guid="guidPasteAsCommentCommandPackageCmdSet" id="MyMenuGroup" /&gt;
&nbsp;&nbsp;&nbsp;&lt;Icon guid="guidImages" id="bmpPic1" /&gt;
&nbsp;&nbsp;&nbsp;&lt;Strings&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;ButtonText&gt;Invoke PasteAsCommentCommand&lt;/ButtonText&gt;
&nbsp;&nbsp;&nbsp;&lt;/Strings&gt;
&lt;/Button&gt;</li>
	<li>Then replace it with the following
&lt;Button guid="guidPasteAsCommentCommandPackageCmdSet" id="PasteAsCommentCommandId" priority="<span style="background-color: #ffffff">0x0300</span>" type="Button"&gt;
&nbsp;&nbsp;&nbsp;&lt;Parent guid="<span style="background-color: #ffffff">guidSHLMainMenu</span>" id="IDG_VS_EDIT_PASTE" /&gt;
&nbsp;&nbsp;&nbsp;&lt;CommandFlag&gt;DefaultInvisible&lt;/CommandFlag&gt;
&nbsp;&nbsp;&nbsp;&lt;CommandFlag&gt;DynamicVisibility&lt;/CommandFlag&gt;
&nbsp;&nbsp;&nbsp;&lt;CommandFlag&gt;DefaultDisabled&lt;/CommandFlag&gt;
&nbsp;&nbsp;&nbsp;&lt;Strings&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;ButtonText&gt;Paste Text As Comment&lt;/ButtonText&gt;
&nbsp;&nbsp;&nbsp;&lt;/Strings&gt;
&lt;/Button&gt;</li>
	<li>Save and close the .vsct file</li>
</ol>
Note, the guidSHLMainMenu:IDG_VS_EDIT_PASTE group is where the existing “Paste JSON As Classes” and “Paste XML As Classes” commands are located. By changing our command’s parent to the same menu group, and setting it’s priority to 0x0300, we have placed our custom “Paste Text As Comment” command in the same menu group, such that it will appear beneath the other two commands.

Additionally, I’ve removed the icon, and also added the various CommandFlags to allow for showing and enabling the command programmatically.
<h5><span style="font-weight: bold">Side Note:</span></h5>
So how did I know to use that guidSHLMainMenu and IDG_VS_EDIT_PASTE value? Finding these values can be tricky. I usually start by searching the .VSCT files that ship with the Visual Studio SDK, to see if I can get a hit on a related menu item. For example:

<a href="https://msdnshared.blob.core.windows.net/media/2016/04/FindInFiles.png"><img style="padding-top: 0px;padding-left: 0px;padding-right: 0px;border-width: 0px" title="FindInFiles" src="https://msdnshared.blob.core.windows.net/media/2016/04/FindInFiles_thumb.png" alt="FindInFiles" width="419" height="409" border="0" /></a>

However, in this instance I didn’t turn up any references to the Paste commands I was interested in (not entirely unexpected). So the next step was use the old <a href="https://blogs.msdn.com/b/dr._ex/archive/2007/04/17/using-enablevsiplogging-to-identify-menus-and-commands-with-vs-2005-sp1.aspx" target="_blank">EnableVSIPLogging trick</a> to find the menu I was interested in. Which resulted in the following:

<a href="https://msdnshared.blob.core.windows.net/media/2016/04/EnableVSIPLogging.png"><img style="padding-top: 0px;padding-left: 0px;padding-right: 0px;border-width: 0px" title="EnableVSIPLogging" src="https://msdnshared.blob.core.windows.net/media/2016/04/EnableVSIPLogging_thumb.png" alt="EnableVSIPLogging" width="325" height="219" border="0" /></a>

So firing up the Find In Files, and casting a wider net. I tried searching all .VSCT files for the word “Special” as that doesn't pop up very often in the VS menus, and found the following in ShellCmdPlace.vsct:

<code>&lt;Menu guid="guidSHLMainMenu" id="IDM_VS_EDITOR_PASTE_MENU" priority="0x0580" type="Menu"&gt;
&lt;Parent guid="guidSHLMainMenu" id="IDG_VS_EDIT_CUTCOPY"/&gt;
&lt;Strings&gt;
&nbsp;&nbsp;&nbsp;&lt;ButtonText&gt;Paste &amp;amp;<strong>Special</strong>&lt;/ButtonText&gt;
&nbsp;&nbsp;&nbsp;&lt;CommandName&gt;Paste &amp;amp;Special&lt;/CommandName&gt;
&lt;/Strings&gt;</code>

But this is the menu definition, and while we could use this to add a new menu group with our command, what I really want to do is find the menu group the other commands are already added to. Unfortunately, this particular menu group is not published in any of the VSSDK files, and I had to resort to searching through the Visual Studio code base to see how the Paste JSON As Classes, was defined:

<code>&lt;Button guid="guidJsonPackageCmdSet" id="cmdidPasteJsonAsClasses" priority="0x0100" type="Button"&gt;
&nbsp;&nbsp;&nbsp;&lt;Parent guid="guidSHLMainMenu" id="<strong>IDG_VS_EDIT_PASTE</strong>" /&gt;
&nbsp;&nbsp;&nbsp;&lt;CommandFlag&gt;DynamicVisibility&lt;/CommandFlag&gt;
&nbsp;&nbsp;&nbsp;&lt;CommandFlag&gt;DefaultInvisible&lt;/CommandFlag&gt;
&nbsp;&nbsp;&nbsp;&lt;CommandFlag&gt;DefaultDisabled&lt;/CommandFlag&gt;
&nbsp;&nbsp;&nbsp;&lt;Strings&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;ButtonText&gt;Paste &amp;amp;JSON As Classes&lt;/ButtonText&gt;
&nbsp;&nbsp;&nbsp;&lt;/Strings&gt;
&lt;/Button&gt;</code>

And as it turns out, the actual ID we want (IDG_VS_EDIT_PASTE) is defined in the vsshlids.h file. So we can happily use that definition from our own VSCT file.
<h4>Specifying When to Load the Package</h4>
By default, this VSPackage will load only when you first selected the menu item. However, because we want to programmatically show and  enable the command, we need to ensure the package is loaded at the most appropriate time. In general, you should avoid loading your package until needed. This particular example only supports C#, so we can force the package to load whenever a C# project is loaded by adding the following attribute to our Package class as follows:

<code>[PackageRegistration(UseManagedResourcesOnly = true)]
[InstalledProductRegistration("#110", "#112", "1.0", IconResourceID = 400)]
[ProvideMenuResource("Menus.ctmenu", 1)]
<strong>[ProvideAutoLoad(VSConstants.UICONTEXT.CSharpProject_string)]</strong>
[Guid(PasteAsCommentCommandPackage.PackageGuidString)]
public sealed class PasteAsCommentCommandPackage : Package
{
…..
}</code>
<h4>Implementing the Command</h4>
First, add a reference to the Microsoft.VisualStudio.Editor.dll, Microsoft.VisualStudio.ComponentModelHost.dll and PresentationCore.dll assemblies. then add the following using statements to your PasteAsCommentCommand.cs file:

<code>using System;
using System.ComponentModel.Design;
using System.Globalization;
using System.Windows;
using Microsoft.VisualStudio.Shell;
using Microsoft.VisualStudio.Shell.Interop;
using Microsoft.VisualStudio.Editor;
using Microsoft.VisualStudio.ComponentModelHost;
using EnvDTE;
using EnvDTE80;</code>

Then add the following helper functions to your PasteAsCommentCommand class:

<code>private DTE2 _dte = null;
DTE2 GetDTE()
{
&nbsp;&nbsp;&nbsp;if (_dte == null)
&nbsp;&nbsp;&nbsp;{
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;_dte = Package.GetGlobalService(typeof(SDTE)) as DTE2;
&nbsp;&nbsp;&nbsp;}
&nbsp;&nbsp;&nbsp;return _dte;
}

private IVsEditorAdaptersFactoryService _adapterFactoryService = null;
IVsEditorAdaptersFactoryService GetAdapterFactoryService()
{
&nbsp;&nbsp;&nbsp;if (_adapterFactoryService==null)
&nbsp;&nbsp;&nbsp;{
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;IComponentModel componentModel = (IComponentModel)Package.GetGlobalService(typeof(SComponentModel));
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;_adapterFactoryService = componentModel.GetService&lt;IVsEditorAdaptersFactoryService&gt;();
&nbsp;&nbsp;&nbsp;}
&nbsp;&nbsp;&nbsp;return _adapterFactoryService;
}</code>

Next, modify the existing PasteAsCommentCommand constructor, to create an OleMenuCommand, instead of a MenuCommand, and add a BeforeQueryStatus handler method, which we will use to show and enable the command programmatically:

<code>private PasteAsCommentCommand(Package package)
{
&nbsp;&nbsp;&nbsp;if (package == null)
&nbsp;&nbsp;&nbsp;{
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;throw new ArgumentNullException("package");
&nbsp;&nbsp;&nbsp;}

&nbsp;&nbsp;&nbsp;this.package = package;

&nbsp;&nbsp;&nbsp;OleMenuCommandService commandService = this.ServiceProvider.GetService(typeof(IMenuCommandService)) as OleMenuCommandService;
&nbsp;&nbsp;&nbsp;if (commandService != null)
&nbsp;&nbsp;&nbsp;{
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var menuCommandID = new CommandID(CommandSet, CommandId);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="text-decoration: line-through">var menuItem = new MenuCommand(this.MenuItemCallback, menuCommandID);</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var menuItem = new OleMenuCommand(this.MenuItemCallback, menuCommandID);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;menuItem.BeforeQueryStatus += MenuItem_BeforeQueryStatus;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;commandService.AddCommand(menuItem);
&nbsp;&nbsp;&nbsp;}
}</code>

Next, implement the MenuItem_BeforeQueryStatus method as follows:

<code>private void MenuItem_BeforeQueryStatus(object sender, EventArgs e)
{
&nbsp;&nbsp;&nbsp;OleMenuCommand pasteCommand = (OleMenuCommand)sender;

&nbsp;&nbsp;&nbsp;// hidden by default
&nbsp;&nbsp;&nbsp;pasteCommand.Visible = false;
&nbsp;&nbsp;&nbsp;pasteCommand.Enabled = false;

&nbsp;&nbsp;&nbsp;Document activeDoc = GetDTE().ActiveDocument;
&nbsp;&nbsp;&nbsp;if (activeDoc != null &amp;&amp; activeDoc.ProjectItem != null &amp;&amp; activeDoc.ProjectItem.ContainingProject != null)
&nbsp;&nbsp;&nbsp;{
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;string lang = activeDoc.Language;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (activeDoc.Language.Equals("CSharp"))
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// show command if active document is a csharp file.
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pasteCommand.Visible = true;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// enable command, if command is visible and there is text on the clipboard
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pasteCommand.Enabled = (pasteCommand.Visible) ? Clipboard.ContainsText() : false;
&nbsp;&nbsp;&nbsp;}
}</code>

And finally, implement the MenuItemCalback method as follows:

<code>private void MenuItemCallback(object sender, EventArgs e)
{
&nbsp;&nbsp;&nbsp;string comment = string.Format("// {0}", Clipboard.GetText());
&nbsp;&nbsp;&nbsp;DTE2 dte = GetDTE();
&nbsp;&nbsp;&nbsp;try
&nbsp;&nbsp;&nbsp;{
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;dte.UndoContext.Open("Paste Text as Comment");
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var selection = (TextSelection)dte.ActiveDocument.Selection;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (selection!= null)
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;selection.Insert(comment);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;dte.ActiveDocument.Activate();
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;dte.ExecuteCommand("Edit.FormatDocument");
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}
&nbsp;&nbsp;&nbsp;}
&nbsp;&nbsp;&nbsp;finally
&nbsp;&nbsp;&nbsp;{
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;dte.UndoContext.Close();
&nbsp;&nbsp;&nbsp;}
}
</code>
<h4>Build and Test the Solution</h4>
<ol>
	<li>Build the Solution</li>
	<li>Launch the Experimental Instance of VS (CTRL+F5), or (F5 if you want to run under the debugger)</li>
	<li>Create a new C# project, or load an existing one</li>
	<li>Open a C# (.cs) source file in the code editor.</li>
	<li>Copy some text to the clipboard</li>
	<li>Click in the code editor, where you want the comment to be added</li>
	<li>The select the <strong>Edit | Paste Special | Paste Text as Comment</strong> command to insert the commented text into the source file</li>
</ol>
<h4>Summary</h4>
And there you have it. A new custom command, added to the Paste Special menu, that will paste any text copied to the clipboard, formatted as a comment, into your C# source file.

In the event I’ve missed something in the above walkthrough, or the casual reader would rather peruse the source, I’ve published the working sample code to the <a href="https://github.com/EdDore/VSXArcana/tree/master/PasteAsComment" target="_blank">VSXArcana Repo</a> on GitHub. Enjoy.]]></content:encoded>
    </item>
    <item>
      <title>The VSX Template Wizard</title>
      <link>https://docs.microsoft.com/archive/blogs/vsx/the-vsx-template-wizard</link>
      <pubDate>Sat, 11 Apr 2015 20:19:00 GMT</pubDate>
      <dc:creator><![CDATA[Ed Dore]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/vsx/2015/04/11/the-vsx-template-wizard/</guid>
      <description><![CDATA[Over the years, I&rsquo;ve built more than a few project templates with wizard support. Usually for...]]></description>
      <content:encoded><![CDATA[<p><br />Over the years, I&rsquo;ve built more than a few project templates with wizard support. Usually for experimental purposes to help answer customer inquiries concerning templates and wizards. Lately, I&rsquo;ve found myself regularly following steps similar to what I outlined in my previous blog entry:</p>
<p>&nbsp;&nbsp; <a href="https://blogs.msdn.com/b/vsx/archive/2014/06/10/creating-a-vsix-deployable-project-or-item-template-with-custom-wizard-support.aspx" target="_blank">Creating a VSIX Deployable Project (or Item) Template with Custom Wizard Support</a></p>
<p>When you find yourself doing something often enough, you just may find yourself motivated enough to automate things a bit. So without further ado, I&rsquo;d like to present: <a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Components.PostAttachments/00/10/60/69/73/VSXArcana.VSXTemplateWizard.vsix" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-components-postattachments/00-10-60-69-73/VSXArcana.VSXTemplateWizard.vsix">The VSX Template Wizard</a>.</p>
<p>Currently, this particular VSIX package doesn&rsquo;t reside in the <a href="https://visualstudiogallery.msdn.microsoft.com/" target="_blank">Visual Studio Extension Gallery</a>, due to a limitation which prevents us from uploading .VSIX files with multiple .zip files to the gallery. This is a gallery limitation that the Visual Studio team is hoping to address in the not to distant future. Until then, the .VSIX will simply reside here, with the source published as a sample at: <a href="https://code.msdn.microsoft.com/Custom-Templates-Wizard-to-8bd2366a" target="_blank">Custom Templates and Wizard to create VSIX Deployable Template with Wizard package</a></p>
<p>When installed, you will find a couple of new project templates, installed under the C#\Extensibility node of your New Project dialog. these new templates will allow you to easily create a VSIX Deployable Project (or Item) Template, with a custom <a href="https://msdn.microsoft.com/en-us/library/vstudio/microsoft.visualstudio.templatewizard.iwizard.aspx" target="_blank">IWizard</a> implementation. The results of which, bear a striking resemblance to the afore mentioned walkthrough.</p>
<h2>Prerequisites</h2>
<p><a href="https://www.visualstudio.com/downloads/" target="_blank">Visual Studio 2013 Community Edition</a> or better, and the <a href="https://www.microsoft.com/en-us/download/details.aspx?id=40758" target="_blank">Visual Studio 2013 SDK</a>.</p>
<p>This VSIX was built with and targets VS 2013. I&rsquo;ve published the source, to serve primarily as a sample. But in the event someone wants to build a similar VSIX for earlier versions of VS, the sample source may also serve as a template for that effort. The projects that these particular templates create, leverage the VSSDK, so that also needs to be installed.</p>
<p>Finally, you need to install the VSX Template Wizard.</p>
<h2>Using the Template</h2>
<p>1. Open the New Project Dialog, then find and select one of the new templates</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/58/metablogapi/7776.NewProjectDialog_03D4E44B.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-58-metablogapi/7776.NewProjectDialog_5F00_03D4E44B.png"><img style="background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-width: 0px;" title="NewProjectDialog" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/58/metablogapi/0435.NewProjectDialog_thumb_3C7F8E58.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-58-metablogapi/0435.NewProjectDialog_5F00_thumb_5F00_3C7F8E58.png" alt="NewProjectDialog" width="527" height="358" border="0" /></a></p>
<p>2. Then click the OK button to create the Project (or Item) Template with Wizard project.</p>
<p>3. Examine/explore the resulting solution. You&rsquo;ll find two projects in the solution similar to the following</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/58/metablogapi/3162.vsxtemplateprojects_1F0D3D4C.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-58-metablogapi/3162.vsxtemplateprojects_5F00_1F0D3D4C.png"><img style="background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-width: 0px;" title="vsxtemplateprojects" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/58/metablogapi/3755.vsxtemplateprojects_thumb_45DB538C.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-58-metablogapi/3755.vsxtemplateprojects_5F00_thumb_5F00_45DB538C.png" alt="vsxtemplateprojects" width="310" height="316" border="0" /></a></p>
<p>Note, the first project is the template project responsible for creating the .zip file that contains the actual template that will be deployed when you install the resulting .VSIX. The second project (MyProjectTemplateWizard) creates the wizard assembly and packages it (and the .zip file from the first project) into a .VSIX that you can use to deploy your template and wizard to other machines.</p>
<p>The TemplateWizard.cs contains a rudimentary IWizard implementation, which you can customize to fit your specific needs. Some wizards require a UI, and others don&rsquo;t. So you&rsquo;ll want to customize the wizard functionality to fit your specific needs.</p>
<h2>The Implementation Details:</h2>
<p>Creating a project template that creates another project template, can be hard to get your head around. The VSXTempateWizard solution includes the following 4 projects:</p>
<ul>
<li><strong>VSXItemTemplate</strong> &ndash; this project creates the VSXItemTemplate.zip, which creates a simple C# Item Template project.</li>
<li><strong>VSXProjectTemplate</strong> &ndash; this project creates the VSXProjectTemplate.zip, which creates a simple C# Project Template project.</li>
<li><strong>VSXWizardTemplate</strong> &ndash; this project creates the VSXWizardTemplate.zip, which creates the wizard assembly and VSIX Package.</li>
<li><strong>VSXTemplateWizard</strong> &ndash; this is the IWizard used by the VSXItemTemplate, VSXProjectTemplate and VSXWizardTemplate to glue everything together.</li>
</ul>
<h5>A Multi-Project Template that isn&rsquo;t</h5>
<p>The first thing you may notice, is that none of these templates are actually <a href="https://msdn.microsoft.com/en-us/library/vstudio/ms185308(v=vs.120).aspx" target="_blank">multi-project templates</a>. Yet, when you create a new &ldquo;Item Template with Wizard&rdquo; project, or &ldquo;Project Template with Wizard&rdquo; project, you get a solution containing 2 projects as shown above. Hence, what we have here is a <strong>Multi-Project Template that isn&rsquo;t</strong>&nbsp; a multi-project template.</p>
<p>One of the more frustrating limitations of the Multi-Project Template, is that you have almost no control over where its various projects are created, or how they get named. However, it&rsquo;s entirely possible to seize control of this, if you designate one project to be the &ldquo;primary&rdquo; project, and implement an IWizard to add the additional projects after the first is generated. This is exactly what the VSXTemplateWizard does. The &ldquo;trick&rdquo; is to mark the subordinate projects as <a href="https://msdn.microsoft.com/en-us/library/ms171390.aspx" target="_blank">hidden</a> (so they don&rsquo;t show up in the New Project or New Item dialog). Then call <a href="https://msdn.microsoft.com/en-us/library/vstudio/behck2xd(v=vs.120).aspx" target="_blank">Solution2.AddFromTemplate</a> <strong>after</strong> the &ldquo;primary&rdquo; project has been completely generated (from the <a href="https://msdn.microsoft.com/en-us/library/vstudio/microsoft.visualstudio.templatewizard.iwizard.projectfinishedgenerating.aspx" target="_blank">IWizard.ProjectFinishedGenerating</a> method). See the VSXTemplateWizard.ProjectFinishedGenerating method in the VSXTemplateWizard.cs in the accompanying sample, for an example of this.</p>
<p>While examining the ProjectFinishedGenerating method also note of the usage of the <a href="https://msdn.microsoft.com/en-us/library/vstudio/vslangproj.vsproject.aspx" target="_blank">VSLangProj.VSProject</a> and <a href="https://msdn.microsoft.com/en-us/library/envdte.configuration.aspx" target="_blank">EnvDTE.Configuration</a> interfaces to change up the debugger settings for the wizard project. The resulting template and wizard projects are configured to run in the Experimental Instance of the IDE, so as to avoid mucking up your actual production environment.</p>
<p>I&rsquo;ll be the first to admit the VSXTemplateWizard is a bit convoluted, but it&rsquo;s used by all 3 of the templates, and I shamefully use a few static variables to store key info, to be used when the wizard is invoked a 2nd time when adding the VSXWizardTemplate project. Hence the checks for which .vstemplate invoked the wizard in the RunStarted method, and the conditional setting of various flags and replacement tokens.</p>
<h5>There can be only one vstemplate</h5>
<p>The VSXItemTemplate and VSXProjectTemplate both produce a &ldquo;Project Template project&rdquo;. This particular project type supports the presence of a single .vstemplate. Note that the &ldquo;other&rdquo; .vstemplate is actually named with a ._vstemplate extension. This is to ensure the project build properly, and that the ._vstemplate doesn&rsquo;t accidentally get displayed in the New Project or Add Item dialogs. The ._vstemplate actually gets renamed to .vstemplate by using the <a href="https://msdn.microsoft.com/en-us/library/ys81cc94.aspx" target="_blank">TargetFileName attribute</a>, in the owning .vstemplate. See the VSXItemTemplate.vstemplate or VSXProjectTemplate.vstemplate, as an example.</p>
<h5>Generating the Key.snk file programmatically</h5>
<p>A custom IWizard assembly needs to be built with a strong name. Given it&rsquo;s not a good idea to distribute the same pre-generated key.snk file, the VSXTemplateWizard generates a new one for each VSXWizardTemplate. The APIs (like <a href="https://msdn.microsoft.com/en-us/library/vstudio/ms231627(v=vs.100).aspx" target="_blank">StrongNameGen</a>) commonly used to generate the contents of a key.snk file are now deprecated. So the VSXTemplateWizard uses the new <a href="https://msdn.microsoft.com/en-us/library/vstudio/dd409349(v=vs.100).aspx" target="_blank">ICLRStrongName</a> interface. This interface currently isn&rsquo;t defined in managed code, so I &ldquo;borrowed&rdquo; the definition the CLR Runtime Team published on <a href="https://clractivation.codeplex.com/SourceControl/latest#Samples" target="_blank">codeplex</a>. See the VSXTemplateWizard.GenerateStrongNameKeyAndToken method in the VSXTemplateWizard.cs file, to see how this interface is retrieved and used to generate the content of the key.snk file.</p>
<h5>Summary</h5>
<p>I believe that pretty much covers it. Hopefully, you&rsquo;ll find the VSX Template Wizard useful. It certainly saves me a bit of time setting up a new templates that need a custom wizard.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Components.PostAttachments/00/10/60/69/73/VSXArcana.VSXTemplateWizard.vsix" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-components-postattachments/00-10-60-69-73/VSXArcana.VSXTemplateWizard.vsix">VSXArcana.VSXTemplateWizard.vsix</a></p>]]></content:encoded>
    </item>
    <item>
      <title>Creating a VSIX Deployable Project (or Item) Template with Custom Wizard Support</title>
      <link>https://docs.microsoft.com/archive/blogs/vsx/creating-a-vsix-deployable-project-or-item-template-with-custom-wizard-support</link>
      <pubDate>Tue, 10 Jun 2014 13:34:00 GMT</pubDate>
      <dc:creator><![CDATA[Ed Dore]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/vsx/2014/06/10/creating-a-vsix-deployable-project-or-item-template-with-custom-wizard-support/</guid>
      <description><![CDATA[Every now and then, I get an interesting question or problem from a customer (thanks Uma) that...]]></description>
      <content:encoded><![CDATA[<p>Every now and then, I get an interesting question or problem from a customer (thanks Uma) that highlights a need for some additional documentation, or at the least a sample or walkthrough to illustrate how to get from A to Z. In this instance, the question was "How do you localize a project (or item) template, to support multiple languages?". Better yet, what if that template uses a custom wizard assembly, and you want to deploy it with a VSIX package?</p>
<p>Given all the moving pieces involved, I've opted to break this down into a couple of different blog entries. The first being this one, which will walk you through creating the initial project. And then a follow up blog entry, that will detail the steps to localized the template, wizard assembly, and VSIX package.</p>
<h2>Prerequisites</h2>
<p>To follow this walkthrough, you will need to install the Visual Studio SDK that matches the version of Visual Studio you are using. If you aren't sure where to find it, there is a list of useful links on the <a href="https://blogs.msdn.com/b/vsx/archive/2012/11/14/welcome-to-the-vsx-arcana-blog.aspx" target="_blank">very first entry of this blog</a> that I keep up to date with links to various downloads and resources. Note, while I used VS 2013 Ultimate to create this project, this same technique can be used for VS 2012 and VS 2010 (Pro or better SKUs).</p>
<h2>Getting Started</h2>
<p>Upon installing the Visual Studio SDK, the following project templates are added to assist you in developing new project and item templates.</p>
<ul>
<li>C# Item Template</li>
<li>C# Project Template</li>
<li>Visual Basic Item Template</li>
<li>Visual Basic Project Template</li>
</ul>
<p>These Project templates create a baseline project or item template, that when built, produces a .zip file that you can manually copy into your ...\Documents\Visual Studio 20<em>xx</em>\Templates directory, and then used to create a new project, or add a new item to an existing project.</p>
<p>The Visual Studio SDK, also includes a stand-alone "VSIX Project" template, which can be used to deploy a template (in addition to other assets).</p>
<p>These VSIX projects do not generate an assembly by default. But if you manually edit a few properties in the .csproj, you can use the VSIX project to build an assembly and have it included as a part of the .VSIX payload.</p>
<p>So instead of creating a solution with a structure similar to the following:</p>
<p>&nbsp;&nbsp; Solution - MyTemplateWithWizard <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - MyProjectTemplate&nbsp;&nbsp; <em>(produces the template as a .zip file)</em> <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - MyTemplateWizard&nbsp;&nbsp; <em>(produces an assembly with an IWizard implementation)</em> <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - MyTemplateWithWizardVSIX&nbsp;&nbsp; <em>(packages the template and assembly into a .VSIX)</em></p>
<p>You can actually implement the wizard assembly with the VSIX project, simplifying the solution structure such that there are only two projects required. For example:</p>
<p>&nbsp;&nbsp; Solution - MyTemplateWithWizard <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - MyProjectTemplate&nbsp; <em>(produces the template as a .zip file)</em> <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - MyProjectWizard&nbsp;&nbsp; <em>(builds the wizard assembly, packaging it and the template into a .VSIX)</em></p>
<p>The following is a walkthrough that will show you how to create a VSIX deployable project template with custom wizard support, using just the two projects as described above.</p>
<p>&nbsp;</p>
<h2>Create a new "C# Project Template" project</h2>
<ol>
<li>Select the File.New.Project... menu item, to invoke the "Add New Project" dialog</li>
<li>Select the "C# Project Template" template and enter a project name as shown below <br /> <br /><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/58/metablogapi/7127.NewTemplateProject_0F4C2332.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-58-metablogapi/7127.NewTemplateProject_5F00_0F4C2332.jpg"><img style="background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-width: 0px;" title="NewTemplateProject" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/58/metablogapi/5074.NewTemplateProject_thumb_010DAA42.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-58-metablogapi/5074.NewTemplateProject_5F00_thumb_5F00_010DAA42.jpg" alt="NewTemplateProject" width="483" height="336" border="0" /></a> </li>
<li>Click the "OK" button to create the initial template project</li>
</ol>
<p>&nbsp;</p>
<h2>Add a new "VSIX Project" to the solution</h2>
<ol>
<li>Right click the "Solution" node in the Solution Explorer, and select the Add.New Project... menu item, to invoke the "Add New Project" dialog</li>
<li>Select the "VSIX Project" template and enter a project name as shown below <br /> <br /><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/58/metablogapi/3821.NewVISXProject_75E41FF7.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-58-metablogapi/3821.NewVISXProject_5F00_75E41FF7.jpg"><img style="background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-width: 0px;" title="NewVISXProject" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/58/metablogapi/4401.NewVISXProject_thumb_6EC4E37F.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-58-metablogapi/4401.NewVISXProject_5F00_thumb_5F00_6EC4E37F.jpg" alt="NewVISXProject" width="481" height="334" border="0" /></a> </li>
<li>Click the "OK" button to create and add the VSIX project to the solution</li>
</ol>
<p>&nbsp;</p>
<h2>Add the template as an asset of the VSIX project.</h2>
<ol>
<li>Open the project's source.extension.vsixmanifest file</li>
<li>In the manifest designer, add a name or company to the "Author:" field</li>
<li>Select the "Assets" tab, then click the "New" button as highlighted below <br /> <br /><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/58/metablogapi/7853.VSIXDesigner_639B5935.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-58-metablogapi/7853.VSIXDesigner_5F00_639B5935.jpg"><img style="background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-width: 0px;" title="VSIXDesigner" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/58/metablogapi/5700.VSIXDesigner_thumb_2E8ECA05.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-58-metablogapi/5700.VSIXDesigner_5F00_thumb_5F00_2E8ECA05.jpg" alt="VSIXDesigner" width="480" height="230" border="0" /></a>&nbsp; </li>
<li>In the "Add New Asset" dialog, select the Type, Source, and Project fields as shown below <br /> <br /><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/58/metablogapi/2656.AddNewAsset_23653FBB.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-58-metablogapi/2656.AddNewAsset_5F00_23653FBB.jpg"><img style="background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-width: 0px;" title="AddNewAsset" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/58/metablogapi/6888.AddNewAsset_thumb_034A32FE.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-58-metablogapi/6888.AddNewAsset_5F00_thumb_5F00_034A32FE.jpg" alt="AddNewAsset" width="330" height="278" border="0" /></a>&nbsp; <br />&nbsp;&nbsp;</li>
</ol>
<h2>Build and Verify</h2>
<ol>
<li>Build the Solution</li>
<li>Launch the VS Experimental Instance with CTRL+F5</li>
<li>Select the File.New.Project... menu item, to invoke the "Add New Project" dialog</li>
<li>Select the "MyProjectTemplate" and create a new project as shown below <br /> <br /><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/58/metablogapi/0525.TestRun_7820A8B3.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-58-metablogapi/0525.TestRun_5F00_7820A8B3.jpg"><img style="background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-width: 0px;" title="TestRun" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/58/metablogapi/5824.TestRun_thumb_09FD3C81.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-58-metablogapi/5824.TestRun_5F00_thumb_5F00_09FD3C81.jpg" alt="TestRun" width="485" height="337" border="0" /></a>&nbsp; </li>
</ol>
<h2>Modify the template.</h2>
<ol>
<li>Change some of the elements displayed in the New Project dialog, by editing the .vstemplate file<ol type="a">
<li>Open the .vstemplate file</li>
<li>Change the Name, Description, and DefaultName elements as highlighted below <br />
<p><span style="font-family: Arial Narrow; font-size: xx-small;">&lt;?<span style="color: #a31515;"><span style="color: #a31515;">xml</span></span><span style="color: #ff0000;"><span style="color: #ff0000;">version</span></span><span style="color: #0000ff;"><span style="color: #0000ff;">=</span></span>"<span style="color: #0000ff;"><span style="color: #0000ff;">1.0</span></span>"<span style="color: #ff0000;"><span style="color: #ff0000;">encoding</span></span><span style="color: #0000ff;"><span style="color: #0000ff;">=</span></span>"<span style="color: #0000ff;"><span style="color: #0000ff;">utf-8</span></span>"</span><span style="font-family: Arial Narrow;"><span style="font-size: xx-small;"><span style="color: #0000ff;"><span style="color: #0000ff;">?&gt; <br />&lt;</span></span><span style="color: #a31515;"><span style="color: #a31515;">VSTemplate</span></span><span style="color: #ff0000;"><span style="color: #ff0000;">Version</span></span><span style="color: #0000ff;"><span style="color: #0000ff;">=</span></span>"<span style="color: #0000ff;"><span style="color: #0000ff;">3.0.0</span></span>"<span style="color: #ff0000;"><span style="color: #ff0000;">Type</span></span><span style="color: #0000ff;"><span style="color: #0000ff;">=</span></span>"<span style="color: #0000ff;"><span style="color: #0000ff;">Project</span></span></span></span><span style="font-family: Arial Narrow;"><span style="font-size: xx-small;">" <br /><span style="color: #ff0000;"><span style="color: #ff0000;"><span lang="">xmlns</span></span><span style="color: #0000ff;"><span style="color: #0000ff;">=</span></span><span style="color: #0000ff;"><span style="color: #0000ff;"><a href="https://schemas.microsoft.com/developer/vstemplate/2005">https://schemas.microsoft.com/developer/vstemplate/2005</a></span></span></span></span></span><span style="color: #ff0000;"><span style="font-family: Arial Narrow;"><span style="font-size: xx-small;"><span style="color: #ff0000;"><span lang="">xmlns:sdk</span></span><span style="color: #0000ff;"><span style="color: #0000ff;">=</span></span>"<span style="color: #0000ff;"><span style="color: #0000ff;">https://schemas.microsoft.com/developer/vstemplate-sdkextension/2010</span></span>"</span></span><span style="font-family: Arial Narrow;"><span style="font-size: xx-small;"><span style="color: #0000ff;"><span style="color: #0000ff;">&gt; <br />&nbsp;&nbsp; &lt;</span></span><span style="color: #a31515;"><span style="color: #a31515;">TemplateData</span></span></span></span><span style="font-family: Arial Narrow;"><span style="font-size: xx-small;"><span style="color: #0000ff;"><span style="color: #0000ff;">&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;</span></span><span style="color: #a31515;"><span style="color: #a31515;">Name</span></span><span style="color: #0000ff;"><span style="color: #0000ff;">&gt;</span></span><span style="background-color: #ffff00;">My Project</span><span style="color: #0000ff;"><span style="color: #0000ff;">&lt;/</span></span><span style="color: #a31515;"><span style="color: #a31515;">Name</span></span></span></span><span style="font-family: Arial Narrow;"><span style="font-size: xx-small;"><span style="color: #0000ff;"><span style="color: #0000ff;">&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;</span></span><span style="color: #a31515;"><span style="color: #a31515;">Description</span></span><span style="color: #0000ff;"><span style="color: #0000ff;">&gt;</span></span><span style="background-color: #ffff00;">My Custom Project Template</span><span style="color: #0000ff;"><span style="color: #0000ff;">&lt;/</span></span><span style="color: #a31515;"><span style="color: #a31515;">Description</span></span></span></span><span style="font-family: Arial Narrow;"><span style="font-size: xx-small;"><span style="color: #0000ff;"><span style="color: #0000ff;">&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;</span></span><span style="color: #a31515;"><span style="color: #a31515;">Icon</span></span><span style="color: #0000ff;"><span style="color: #0000ff;">&gt;</span></span>MyProjectTemplate.ico<span style="color: #0000ff;"><span style="color: #0000ff;">&lt;/</span></span><span style="color: #a31515;"><span style="color: #a31515;">Icon</span></span></span></span><span style="font-family: Arial Narrow;"><span style="font-size: xx-small;"><span style="color: #0000ff;"><span style="color: #0000ff;">&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;</span></span><span style="color: #a31515;"><span style="color: #a31515;">ProjectType</span></span><span style="color: #0000ff;"><span style="color: #0000ff;">&gt;</span></span>CSharp<span style="color: #0000ff;"><span style="color: #0000ff;">&lt;/</span></span><span style="color: #a31515;"><span style="color: #a31515;">ProjectType</span></span></span></span><span style="font-family: Arial Narrow;"><span style="font-size: xx-small;"><span style="color: #0000ff;"><span style="color: #0000ff;">&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;</span></span><span style="color: #a31515;"><span style="color: #a31515;">RequiredFrameworkVersion</span></span><span style="color: #0000ff;"><span style="color: #0000ff;">&gt;</span></span>2.0<span style="color: #0000ff;"><span style="color: #0000ff;">&lt;/</span></span><span style="color: #a31515;"><span style="color: #a31515;">RequiredFrameworkVersion</span></span></span></span><span style="font-family: Arial Narrow;"><span style="font-size: xx-small;"><span style="color: #0000ff;"><span style="color: #0000ff;">&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;</span></span><span style="color: #a31515;"><span style="color: #a31515;">SortOrder</span></span><span style="color: #0000ff;"><span style="color: #0000ff;">&gt;</span></span>1000<span style="color: #0000ff;"><span style="color: #0000ff;">&lt;/</span></span><span style="color: #a31515;"><span style="color: #a31515;">SortOrder</span></span></span></span><span style="font-family: Arial Narrow;"><span style="font-size: xx-small;"><span style="color: #0000ff;"><span style="color: #0000ff;">&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;</span></span><span style="color: #a31515;"><span style="color: #a31515;">TemplateID</span></span><span style="color: #0000ff;"><span style="color: #0000ff;">&gt;</span></span>0504f2de-af7a-4065-a542-f65ca8c61790<span style="color: #0000ff;"><span style="color: #0000ff;">&lt;/</span></span><span style="color: #a31515;"><span style="color: #a31515;">TemplateID</span></span></span></span><span style="font-family: Arial Narrow;"><span style="font-size: xx-small;"><span style="color: #0000ff;"><span style="color: #0000ff;">&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;</span></span><span style="color: #a31515;"><span style="color: #a31515;">CreateNewFolder</span></span><span style="color: #0000ff;"><span style="color: #0000ff;">&gt;</span></span>true<span style="color: #0000ff;"><span style="color: #0000ff;">&lt;/</span></span><span style="color: #a31515;"><span style="color: #a31515;">CreateNewFolder</span></span></span></span><span style="font-family: Arial Narrow;"><span style="font-size: xx-small;"><span style="color: #0000ff;"><span style="color: #0000ff;">&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;</span></span><span style="color: #a31515;"><span style="color: #a31515;">DefaultName</span></span><span style="color: #0000ff;"><span style="color: #0000ff;">&gt;</span></span><span style="background-color: #ffff00;">MyProject</span><span style="color: #0000ff;"><span style="color: #0000ff;">&lt;/</span></span><span style="color: #a31515;"><span style="color: #a31515;">DefaultName</span></span></span></span><span style="font-family: Arial Narrow;"><span style="font-size: xx-small;"><span style="color: #0000ff;"><span style="color: #0000ff;">&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;</span></span><span style="color: #a31515;"><span style="color: #a31515;">ProvideDefaultName</span></span><span style="color: #0000ff;"><span style="color: #0000ff;">&gt;</span></span>true<span style="color: #0000ff;"><span style="color: #0000ff;">&lt;/</span></span><span style="color: #a31515;"><span style="color: #a31515;">ProvideDefaultName</span></span></span></span><span style="font-family: Arial Narrow;"><span style="font-size: xx-small;"><span style="color: #0000ff;"><span style="color: #0000ff;">&gt; <br />&nbsp;&nbsp; &lt;/</span></span><span style="color: #a31515;"><span style="color: #a31515;">TemplateData</span></span></span></span><span style="font-family: Arial Narrow;"><span style="font-size: xx-small;"><span style="color: #0000ff;"><span style="color: #0000ff;">&gt; <br />&nbsp;&nbsp; &lt;</span></span><span style="color: #a31515;"><span style="color: #a31515;">TemplateContent</span></span></span></span><span style="font-family: Arial Narrow;"><span style="font-size: xx-small;"><span style="color: #0000ff;"><span style="color: #0000ff;">&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;</span></span><span style="color: #a31515;"><span style="color: #a31515;">Project</span></span><span style="color: #ff0000;"><span style="color: #ff0000;">File</span></span><span style="color: #0000ff;"><span style="color: #0000ff;">=</span></span>"<span style="color: #0000ff;"><span style="color: #0000ff;">ProjectTemplate.csproj</span></span>"<span style="color: #ff0000;"><span style="color: #ff0000;">ReplaceParameters</span></span><span style="color: #0000ff;"><span style="color: #0000ff;">=</span></span>"<span style="color: #0000ff;"><span style="color: #0000ff;">true</span></span>"</span></span><span style="font-family: Arial Narrow;"><span style="font-size: xx-small;"><span style="color: #0000ff;"><span style="color: #0000ff;">&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;</span></span><span style="color: #a31515;"><span style="color: #a31515;">ProjectItem</span></span><span style="color: #ff0000;"><span style="color: #ff0000;">ReplaceParameters</span></span><span style="color: #0000ff;"><span style="color: #0000ff;">=</span></span>"<span style="color: #0000ff;"><span style="color: #0000ff;">true</span></span>"<span style="color: #ff0000;"><span style="color: #ff0000;">TargetFileName</span></span><span style="color: #0000ff;"><span style="color: #0000ff;">=</span></span>"<span style="color: #0000ff;"><span style="color: #0000ff;">Properties\AssemblyInfo.cs</span></span>"<span style="color: #0000ff;"><span style="color: #0000ff;">&gt;</span></span>AssemblyInfo.cs<span style="color: #0000ff;"><span style="color: #0000ff;">&lt;/</span></span><span style="color: #a31515;"><span style="color: #a31515;">ProjectItem</span></span></span></span><span style="font-family: Arial Narrow;"><span style="font-size: xx-small;"><span style="color: #0000ff;"><span style="color: #0000ff;">&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;</span></span><span style="color: #a31515;"><span style="color: #a31515;">ProjectItem</span></span><span style="color: #ff0000;"><span style="color: #ff0000;">ReplaceParameters</span></span><span style="color: #0000ff;"><span style="color: #0000ff;">=</span></span>"<span style="color: #0000ff;"><span style="color: #0000ff;">true</span></span>"<span style="color: #ff0000;"><span style="color: #ff0000;">OpenInEditor</span></span><span style="color: #0000ff;"><span style="color: #0000ff;">=</span></span>"<span style="color: #0000ff;"><span style="color: #0000ff;">true</span></span>"<span style="color: #0000ff;"><span style="color: #0000ff;">&gt;</span></span>Class1.cs<span style="color: #0000ff;"><span style="color: #0000ff;">&lt;/</span></span><span style="color: #a31515;"><span style="color: #a31515;">ProjectItem</span></span></span></span><span style="font-family: Arial Narrow;"><span style="font-size: xx-small;"><span style="color: #0000ff;"><span style="color: #0000ff;">&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/</span></span><span style="color: #a31515;"><span style="color: #a31515;">Project</span></span></span></span><span style="font-family: Arial Narrow;"><span style="font-size: xx-small;"><span style="color: #0000ff;"><span style="color: #0000ff;">&gt; <br />&nbsp;&nbsp; &lt;/</span></span><span style="color: #a31515;"><span style="color: #a31515;">TemplateContent</span></span></span></span><span style="font-family: Arial Narrow;"><span style="font-size: xx-small;"><span style="color: #0000ff;"><span style="color: #0000ff;">&gt; <br /></span></span><span style="color: #0000ff;"><span style="color: #0000ff;">&lt;/</span></span><span style="color: #a31515;"><span style="color: #a31515;">VSTemplate</span></span><span style="color: #0000ff;"><span style="color: #0000ff;">&gt;</span></span></span></span></span>&nbsp;&nbsp;</p>
</li>
</ol></li>
<li>Rename Class1.cs to something more appropriate.<ol type="a">
<li>Right click "Class1.cs" in the Solution Explorer, and select the "Rename" menu item</li>
<li>Rename Class1.cs to MyProject.cs</li>
<li>Open MyProject.cs, and change the classname from Class1 to MyProject, and add a simple comment as shown below</li>
</ol></li>
</ol>
<p>&nbsp;</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/58/metablogapi/6366.AddComment_4031D5A6.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-58-metablogapi/6366.AddComment_5F00_4031D5A6.jpg"><img style="background-image: none; float: none; padding-top: 0px; padding-left: 0px; margin-left: auto; display: block; padding-right: 0px; margin-right: auto; border-width: 0px;" title="AddComment" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/58/metablogapi/7271.AddComment_thumb_4834C82F.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-58-metablogapi/7271.AddComment_5F00_thumb_5F00_4834C82F.jpg" alt="AddComment" width="512" height="237" border="0" /></a>&nbsp;</p>
<ol>
<li>Fixup the .vstemplate and .csproj<ol type="a">
<li>Open the .vstemplate file, find and rename "Class1.cs" to "MyProject.cs"</li>
<li>Open the template's .csproj file, find and rename "Class1.cs" to "MyProject.cs"</li>
</ol></li>
<li>(Optional) Build and Test in the Experimental Instance again</li>
</ol>
<p>&nbsp;</p>
<h2>Modify the .VSIX project to build a custom wizard implementation.</h2>
<ol>
<li>Modify the project's properties to build an assembly.<ol type="a">
<li>Right click the VISX Project node in the Solution Explorer, and select "Unload Project"</li>
<li>Right click the VISX Project node in the Solution Explorer, and select "Edit MyProjectWizard.cs"</li>
<li>Change the following properties from "false" to "true" <br /> <br />&lt;IncludeAssemblyInVSIXContainer<span style="background-color: #ffff00;">&gt;true</span>&lt;/IncludeAssemblyInVSIXContainer&gt;&nbsp; <br />&lt;IncludeDebugSymbolsInVSIXContainer&gt;<span style="background-color: #ffff00;">true</span>&lt;/IncludeDebugSymbolsInVSIXContainer&gt;&nbsp; <br />&lt;IncludeDebugSymbolsInLocalVSIXDeployment&gt;<span style="background-color: #ffff00;">true</span>&lt;/IncludeDebugSymbolsInLocalVSIXDeployment&gt;</li>
<li>Save MyProjectWizard.csproj</li>
<li>Right click the VSIX Project node in Solution Explorer, and select "Reload Project"</li>
</ol></li>
<li>Add a reference to EnvDTE.dll. Select the envdte node in Solution Explorer, and in the Properties toolwindow, change the "Embed Interop Types" property to "False", to ensure a clean build</li>
<li>Add a reference to the Microsoft.VisualStudio.TemplateWizardInterface.dll</li>
<li>Right click the VSIX Project node in Solution Explorer, and select Add.Class... menu item</li>
<li>Add a new class called MyProjectWizard.cs</li>
<li>Replace the contents of MyProjectWizard.cs with the following <br /><span style="font-family: Consolas;"><span><span style="color: #0000ff;"><span style="font-size: 9.8pt;"> <br /><span style="font-family: Arial Narrow; font-size: xx-small;">using</span></span></span></span><span style="font-size: 9.8pt;"><span style="font-family: Arial Narrow; font-size: xx-small;"> System; <br /><span><span style="color: #0000ff;">using</span></span> System.Collections.Generic; <br /><span><span style="color: #0000ff;">using</span></span> EnvDTE; <br /><span><span style="color: #0000ff;">using</span></span> Microsoft.VisualStudio.TemplateWizard; <br /> <br /><span><span style="color: #0000ff;">namespace</span></span> MyProjectWizard <br />{ <br />&nbsp;&nbsp;&nbsp; <span><span style="color: #0000ff;">public</span></span>&nbsp;<span><span style="color: #0000ff;">class</span></span>&nbsp;<span><span style="color: #2b91af;">MyProjectWizard</span></span> : <span><span style="color: #2b91af;">IWizard</span></span> <br />&nbsp;&nbsp;&nbsp; { <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span><span style="color: #0000ff;">private</span></span>&nbsp;<span><span style="color: #2b91af;">DTE</span></span> _dte; <br /> <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span><span style="color: #0000ff;">public</span></span>&nbsp;<span><span style="color: #0000ff;">void</span></span> BeforeOpeningFile(<span><span style="color: #2b91af;">ProjectItem</span></span> projectItem) { } <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span><span style="color: #0000ff;">public</span></span>&nbsp;<span><span style="color: #0000ff;">void</span></span> ProjectFinishedGenerating(<span><span style="color: #2b91af;">Project</span></span> project) { } <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span><span style="color: #0000ff;">public</span></span>&nbsp;<span><span style="color: #0000ff;">void</span></span> ProjectItemFinishedGenerating(<span><span style="color: #2b91af;">ProjectItem</span></span> projectItem) { } <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span><span style="color: #0000ff;">public</span></span>&nbsp;<span><span style="color: #0000ff;">void</span></span> RunFinished() { } <br /> <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span><span style="color: #0000ff;">public</span></span>&nbsp;<span><span style="color: #0000ff;">void</span></span> RunStarted(<span><span style="color: #0000ff;">object</span></span> automationObject, <span><span style="color: #2b91af;">Dictionary</span></span>&lt;<span><span style="color: #0000ff;">string</span></span>, <span><span style="color: #0000ff;">string</span></span>&gt; replacementsDictionary, <span><span style="color: #2b91af;">WizardRunKind</span></span> runKind, <span><span style="color: #0000ff;">object</span></span>[] customParams) <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; { <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; _dte = (<span><span style="color: #2b91af;">DTE</span></span>)automationObject; <br /> <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span><span style="color: #008000;">// add an entry to the dictionary to specify the string used for the $greeting$ token</span></span> <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; replacementsDictionary.Add(<span><span style="color: #a31515;">"$greeting$"</span></span>, <span><span style="color: #a31515;">"Hello Custom Library"</span></span>); <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } <br /> <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span><span style="color: #0000ff;">public</span></span>&nbsp;<span><span style="color: #0000ff;">bool</span></span> ShouldAddProjectItem(<span><span style="color: #0000ff;">string</span></span> filePath) { <span><span style="color: #0000ff;">return</span></span>&nbsp;<span><span style="color: #0000ff;">true</span></span>; } <br />&nbsp;&nbsp;&nbsp; } <br />} <br /></span> <br /></span></span></li>
<li>Open the source.extension.vsixmanifest, select the Assets tab, and click the "New" button</li>
<li>In the "Add New Asset" dialog, select the Type, Source, and Project fields as shown below <br /> <br /><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/58/metablogapi/6087.AddNewAsset2_1E828BFF.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-58-metablogapi/6087.AddNewAsset2_5F00_1E828BFF.jpg"><img style="background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-width: 0px;" title="AddNewAsset2" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/58/metablogapi/4834.AddNewAsset2_thumb_7E677F41.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-58-metablogapi/4834.AddNewAsset2_5F00_thumb_5F00_7E677F41.jpg" alt="AddNewAsset2" width="402" height="339" border="0" /></a> </li>
<li>Select File.Save All to ensure all the above changes are saved</li>
<li>Strong Name the Assembly (Wizard assemblies need to be strong named)<ol type="a">
<li>Right Click the VSIX Project node in Solution Explorer, and select the Properties menu item</li>
<li>In the Project Designer, select the "Signing" tab</li>
<li>Check the "Sign the Assembly" checkbox as shown below <br /> <br /><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/58/metablogapi/2781.Signing_0C39C53D.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-58-metablogapi/2781.Signing_5F00_0C39C53D.jpg"><img style="background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-width: 0px;" title="Signing" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/58/metablogapi/0647.Signing_thumb_6C1EB87F.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-58-metablogapi/0647.Signing_5F00_thumb_5F00_6C1EB87F.jpg" alt="Signing" width="525" height="310" border="0" /></a> </li>
<li>Select "&lt;New...&gt; in the "Choose a strong name key file"</li>
<li>In the "Create Strong Name Key" dialog, enter "key.snk" for the Key filename</li>
<li>Uncheck the "Protect my key file with a password" checkbox, and click the OK button <br />&nbsp;</li>
</ol></li>
</ol>
<h2>Associate the Wizard with the project template</h2>
<ol>
<li>Run SN.EXE -T on the wizard assembly to retrieve the public token key</li>
<li><strong>Tip:</strong> Create an external tool entry on the Tools menu, as described in Jeremiah Clark's blog <a href="https://blogs.msdn.com/b/miah/archive/2008/02/19/visual-studio-tip-get-public-key-token-for-a-stong-named-assembly.aspx" target="_blank">Visual Studio Tip: Get Public Key Token for a Strong Named Assembly</a></li>
<li>Open the template's .vstemplate file and add the following &lt;WizardExtension&gt; section <br />
<p>&lt;<span style="color: #a31515; font-size: x-small;"><span style="color: #a31515; font-size: x-small;">WizardExtension</span></span><span style="color: #0000ff; font-size: x-small;"><span style="color: #0000ff; font-size: x-small;">&gt; <br />&nbsp;&nbsp; &lt;</span></span><span style="color: #a31515; font-size: x-small;"><span style="color: #a31515; font-size: x-small;">Assembly</span></span><span style="color: #0000ff; font-size: x-small;"><span style="color: #0000ff; font-size: x-small;">&gt;</span></span><span style="font-size: x-small;">MyProjectWizard, Version=1.0.0.0, Culture=neutral, PublicKeyToken=22c2a1a5fa7b6905</span><span style="color: #0000ff; font-size: x-small;"><span style="color: #0000ff; font-size: x-small;">&lt;/</span></span><span style="color: #a31515; font-size: x-small;"><span style="color: #a31515; font-size: x-small;">Assembly</span></span><span style="color: #0000ff; font-size: x-small;"><span style="color: #0000ff; font-size: x-small;">&gt; <br />&nbsp;&nbsp; &lt;</span></span><span style="color: #a31515; font-size: x-small;"><span style="color: #a31515; font-size: x-small;">FullClassName</span></span><span style="color: #0000ff; font-size: x-small;"><span style="color: #0000ff; font-size: x-small;">&gt;</span></span><span style="font-size: x-small;">MyProjectWizard.MyProjectWizard</span><span style="color: #0000ff; font-size: x-small;"><span style="color: #0000ff; font-size: x-small;">&lt;/</span></span><span style="color: #a31515; font-size: x-small;"><span style="color: #a31515; font-size: x-small;">FullClassName</span></span><span style="color: #0000ff; font-size: x-small;"><span style="color: #0000ff; font-size: x-small;">&gt; <br />&lt;/</span></span><span style="color: #a31515; font-size: x-small;"><span style="color: #a31515; font-size: x-small;">WizardExtension</span></span><span style="color: #0000ff; font-size: x-small;"><span style="color: #0000ff; font-size: x-small;">&gt;</span></span></p>
</li>
<li>Open the template project's MyProject.cs file, and replace the comment line with the following <br /><span style="font-family: Consolas;"><span><span style="color: #0000ff;"><span style="font-size: 9.8pt;"> <br /><span style="font-family: Arial Narrow; font-size: xx-small;">using</span></span></span></span></span><span style="font-family: Arial Narrow; font-size: xx-small;"> System; <br /><span><span style="color: #0000ff;">using</span></span> System.Collections.Generic; <br />$<span><span style="color: #0000ff;">if</span></span>$ ($targetframeworkversion$ &gt;= 3.5)<span><span style="color: #0000ff;">using</span></span> System.Linq; <br />$endif$<span><span style="color: #0000ff;">using</span></span> System.Text; <br /> <br /><span><span style="color: #0000ff;">namespace</span></span> $safeprojectname$ <br />{ <br />&nbsp;&nbsp;&nbsp; <span><span style="color: #008000; background-color: #ffff00;">// $greeting$</span></span> <br />&nbsp;&nbsp;&nbsp; <span><span style="color: #0000ff;">public</span></span>&nbsp;<span><span style="color: #0000ff;">class</span></span>&nbsp;<span><span style="color: #2b91af;">MyProject</span></span> <br />&nbsp;&nbsp;&nbsp; { <br />&nbsp;&nbsp;&nbsp; } <br />}</span>&nbsp; <br />&nbsp;&nbsp;</li>
</ol>
<h2>Build and Test the Solution</h2>
<ol>
<li>Build the Solution</li>
<li>Set a breakpoint on the MyProjectWizard.RunStarted method</li>
<li>Launch the Experimental Instance with the debugger (F5)</li>
<li>Select the File.New.Project... menu item, to invoke the "Add New Project" dialog</li>
<li>Select the "My Project Template", and click the OK button</li>
<li>When the breakpoint is hit, select Debug.Continue (or F5) and let the wizard run to completion</li>
<li>Note the new comment added to the resulting MyProject.cs file</li>
</ol>
<p>&nbsp;</p>
<h2>Summary</h2>
<p>And there you have it, a VSIX deployable template with a custom wizard support. When finished, use the resulting .VSIX file to deploy the template to your production environment. And if you think others will find your template useful, consider uploading it to the <a href="https://visualstudiogallery.msdn.microsoft.com/" target="_blank">VS Extension Gallery</a>.</p>
<p>The resulting code from the above walkthrough can be downloaded from <a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/58/7838.MyProjectTemplate.zip" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-58/7838.MyProjectTemplate.zip" target="_blank">here</a>.</p>]]></content:encoded>
    </item>
    <item>
      <title>VS 2013 SDK Samples released</title>
      <link>https://docs.microsoft.com/archive/blogs/vsx/vs-2013-sdk-samples-released</link>
      <pubDate>Fri, 30 May 2014 14:41:55 GMT</pubDate>
      <dc:creator><![CDATA[Ed Dore]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/vsx/2014/05/30/vs-2013-sdk-samples-released/</guid>
      <description><![CDATA[It took a bit longer than we’d have liked, but the VS team has finally gotten around to porting and...]]></description>
      <content:encoded><![CDATA[<p>It took a bit longer than we’d have liked, but the VS team has finally gotten around to porting and posting the original VS SDK samples from VS 2010, over to VS 2013. Below is a listing of the samples and where they can be downloaded from.</p>  <p><a href="https://code.msdn.microsoft.com/Build-Progress-Bar-VS-2013-35f02ee7" target="_blank">Build Progress Bar – VS 2013</a></p>  <blockquote>   <p>A Visual Studio Package which provides a new tool window called &quot;Build Progress&quot; which displays a WPF ProgressBar indicating percentage completion of the current solution build.</p> </blockquote>  <p><a href="https://code.msdn.microsoft.com/Caret-Fish-Eye-VS-2013-35841c88" target="_blank">Caret Fish Eye – VS 2013</a></p>  <blockquote>   <p>This is a sample extension for Visual Studio 2013 that visually scales lines to be smaller the farther away from the caret's current position they are. It accomplishes this using the line transformation API.</p> </blockquote>  <p><a href="https://code.msdn.microsoft.com/Code-Sweep-VS-2013-6821755d" target="_blank">Code Sweep – VS 2013</a></p>  <blockquote>   <p>This sample allows the user to specify a set of terms to search for by specifying a set of XML files containing the term definitions. The user-configurable settings are stored in the project file. The scan can be invoked either on command or as an integrated part of the build process. When the scan is performed, a custom task provider causes hits, if any, to be shown in the task list.</p> </blockquote>  <p><a href="https://code.msdn.microsoft.com/Command-Target-RGB-VS-2013-00fdf8de" target="_blank">Command Target RGB – VS 2013</a></p>  <blockquote>   <p>A Visual Studio Package which provides a multi-instance tool window called &quot;Red Green Blue&quot; which hosts a toolbar with three buttons that will change the tool window's background color and move the toolbar in the frame.</p> </blockquote>  <p><a href="https://code.msdn.microsoft.com/Completion-Tooltip-d5e6c3b8" target="_blank">Completion Tooltip Customization – VS 2013</a></p>  <blockquote>   <p>This is a sample extension for the Visual Studio 2013 editor that replaces the completion tooltip UI.</p> </blockquote>  <p><a href="https://code.msdn.microsoft.com/WPF-Designer-over-XML-VS-6ec6b363" target="_blank">WPF Designer over SML – VS 2013</a></p>  <blockquote>   <p>Demonstrates how to create an extension with a WPF-based Visual Designer for editing XML files with a specific schema (XSD) in coordination with the Visual Studio XML Editor.</p> </blockquote>  <p><a href="https://code.msdn.microsoft.com/Diff-Classifier-VS-2013-2e563578" target="_blank">Diff Classifier – VS 2013</a></p>  <blockquote>   <p>This is a sample Visual Studio 2013 classifier for diff/patch files. It provides formatting for the various line types found in diff files using the classification API. </p> </blockquote>  <p><a href="https://code.msdn.microsoft.com/Highlight-Word-VS-2013-8ea86311" target="_blank">Highlight Word – VS 2013</a></p>  <blockquote>   <p>This is a Visual Studio 2013 sample extension that uses tagging and adornments to highlight all the occurences of the word currently under the caret.</p> </blockquote>  <p><a href="https://code.msdn.microsoft.com/Inline-XPS-Viewer-VS-2013-fe5a86f8" target="_blank">Inline XPS Viewer – VS 2013</a></p>  <blockquote>   <p>This is a sample adornment extension showing how to host a document viewer in Editor code window. In the doc viewer you can zoom in/out, view whole/2 pages, print and find text in the doc.</p> </blockquote>  <p><a href="https://code.msdn.microsoft.com/Intra-text-adornment-VS-9257bc99" target="_blank">Intra-text adornment – VS 2013</a></p>  <blockquote>   <p>This is a sample extension for the Visual Studio 2013 editor that replaces a hexadecimal color with a color swatch using intra-text adornments.</p> </blockquote>  <p><a href="https://code.msdn.microsoft.com/Ook-Language-sample-VS-2013-92660d3d" target="_blank">Ook Language sample – VS 2013</a></p>  <blockquote>   <p>This is the example used during the Visual Studio Ecosystem Summit Presentation &quot;Getting Linguistic: Integrating a Language into Visual Studio&quot; by Chris Granger. It implements the following language features for the esoteric language &quot;Ook!&quot;:</p> </blockquote>  <p><a href="https://code.msdn.microsoft.com/Reference-Package-VS-2013-e043399d" target="_blank">Reference Package – VS 2013</a></p>  <blockquote>   <p>This sample shows how to create a Visual Studio package and how to add an entry into the Help About dialog. </p> </blockquote>  <p><a href="https://code.msdn.microsoft.com/Reference-Service-VS-2013-5249e0a5" target="_blank">Reference Service – VS 2013</a></p>  <blockquote>   <p>This sample shows how to be a Visual Studio service provider and how to consume Visual Studio services.</p> </blockquote>  <p><a href="https://code.msdn.microsoft.com/Single-File-Generator-VS-f64b7d0a" target="_blank">Single File Generator – VS 2013</a></p>  <blockquote>   <p>This sample demonstrates how to build a single file generator.</p> </blockquote>  <p><a href="https://code.msdn.microsoft.com/Source-Control-Provider-VS-6c2fe827#content" target="_blank">Source Control Provider – VS 2013</a></p>  <blockquote>   <p>This sample demonstrates how to create a source code control provider.</p> </blockquote>  <p><a href="https://code.msdn.microsoft.com/Todo-Classification-VS-2013-08c1e630" target="_blank">Todo Classification – VS 2013</a></p>  <blockquote>   <p>This is the sample code written during the Visual Studio Ecosystem Summit presentation &quot;I Want Coloring: A scenario based look at the new editor&quot;. It provides a general purpose TodoTagger as well as classification and a glyph factory. </p> </blockquote>  <p><a href="https://code.msdn.microsoft.com/TodoGlyphFactory-VS-2013-f0987645" target="_blank">Todo Glyph Factory – VS 2013</a></p>  <blockquote>   <p>This sample adds a glyph in the glyph margin on all lines that have comments with the word &quot;todo&quot; in them. It demonstrates how to create a custom glyph factory that uses a tagger.</p> </blockquote>  <p><a href="https://code.msdn.microsoft.com/Typing-Speed-Meter-VS-2013-6c11f133" target="_blank">Typing Speed Meter – VS 2013</a></p>  <blockquote>   <p>This is a sample editor extension for Visual Studio 2013 that uses and IVsTextViewCreationListener and an adornment to create a typing speed meter. </p> </blockquote>  <p><a href="https://code.msdn.microsoft.com/Spell-Checker-VS-2013-2354c9b9" target="_blank">Spell Checker – VS 2013</a></p>  <blockquote>   <p>This sample uses smart tags and squiggles to display spelling errors in your comments inside of Visual Studio 2013. The extension provides an excellent example of how you use other services in combination with those provided in VS to add real-world functionality to the editor. </p> </blockquote>  <p><a href="https://code.msdn.microsoft.com/Options-Page-VS-2013-6d9ab084" target="_blank">Options Page – VS 2013</a></p>  <blockquote>   <p>This sample demonstrates how to add custom options pages into the standard Visual Studio Options dialog. The sample adds two options pages and demonstrates how to customize the presentation and properties' persistence. </p> </blockquote>  <p><a href="https://code.msdn.microsoft.com/Running-Document-Table-66833f9d" target="_blank">Running Document Table Explorer – VS 2013</a></p>  <blockquote>   <p>This sample demonstrates how to create an explorer that logs Running Document Table (RDT) events. Selecting an event from the grid displays its properties in the Properties Window.</p> </blockquote>  <p><a href="https://code.msdn.microsoft.com/WPF-Tool-Window-VS-2013-ecfaff6f" target="_blank">WPF Tool Window – VS 2013</a></p>  <blockquote>   <p>This sample demonstrates how to create a package that provides tool windows which host Windows Forms controls and WPF controls. </p> </blockquote>  <p><a href="https://code.msdn.microsoft.com/Windows-Forms-Control-c845acb9" target="_blank">Windows Forms Control Installer – VS 2013</a></p>  <blockquote>   <p>This sample demonstrates how to create a Visual Studio package (VSPackage) that loads custom Windows Forms controls into the Toolbox. The code defines two toolbox items: MyCustomTextBox, which is a normal Windows Forms control, and MyCustomTextBoxWithPopup, which provides a custom ToolboxItem that pops up a dialog box when the item is added.</p> </blockquote>  <p><a href="https://code.msdn.microsoft.com/vstudio/Menu-and-commands-VS-2013-71c62827" target="_blank">Menu and commands – VS 2013</a></p>  <blockquote>   <p>This sample demonstrates how to create menu and command items and visualize them inside Visual Studio’s menus and toolbars. </p> </blockquote>  <p><a href="https://code.msdn.microsoft.com/vstudio/Editor-with-Toolbox-VS-2013-43ed7e51" target="_blank">Editor with Toolbox – VS 2013</a></p>  <blockquote>   <p>This sample demonstrates how to create a package that provides an Editor type extended with Toolbox support.</p> </blockquote>  <p><a href="https://code.msdn.microsoft.com/vstudio/Combo-Box-VS-2013-f559a468" target="_blank">Combo Box – VS 2013</a></p>  <blockquote>   <p>This sample demonstrates how to create combo boxes on Visual Studio’s toolbars. Four types of combo boxes that can be created are shown in this sample. </p> </blockquote>  <p><a href="https://code.msdn.microsoft.com/vstudio/MSDN-Search-VS-2013-7053588b" target="_blank">MSDN Search – VS 2013</a></p>  <blockquote>   <p>This sample demonstrates how to extend Quick Launch and add a search provider to search outside Tools Options / Menus / Open Documents (the built-in providers).</p> </blockquote>  <p><a href="https://code.msdn.microsoft.com/vstudio/Basic-Source-Control-669772a7" target="_blank">Basic Source Control Provider – VS 2013</a></p>  <blockquote>   <p>This sample demonstrates how to create a source control provider that registers with Visual Studio and can be selected as active source control provider.</p> </blockquote>  <p>Alternatively, you can download the entire set of above samples from: </p>  <blockquote>   <p><a href="https://code.msdn.microsoft.com/VIsual-Studio-2013-SDK-728822a7" target="_blank">Visual Studio 2013 SDK Samples</a>.</p></blockquote>]]></content:encoded>
    </item>
    <item>
      <title>VS 2013 Isolated Shell generates an error when attempting to load a custom project type</title>
      <link>https://docs.microsoft.com/archive/blogs/vsx/vs-2013-isolated-shell-generates-an-error-when-attempting-to-load-a-custom-project-type</link>
      <pubDate>Wed, 16 Apr 2014 10:17:00 GMT</pubDate>
      <dc:creator><![CDATA[Ed Dore]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/vsx/2014/04/16/vs-2013-isolated-shell-generates-an-error-when-attempting-to-load-a-custom-project-type/</guid>
      <description><![CDATA[After adding support for a custom project type to a VS 2013 Isolated Shell project, you may...]]></description>
      <content:encoded><![CDATA[<p>After adding support for a custom project type to a VS 2013 Isolated Shell project, you may encounter the following error dialog.</p>
<p>&nbsp;</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/58/metablogapi/7357.BeginBuild_0C99FB2C.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-58-metablogapi/7357.BeginBuild_5F00_0C99FB2C.png"><img style="background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-width: 0px;" title="BeginBuild" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/56/58/metablogapi/3175.BeginBuild_thumb_7481E0F7.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-56-58-metablogapi/3175.BeginBuild_5F00_thumb_5F00_7481E0F7.png" alt="BeginBuild" width="469" height="173" border="0" /></a></p>
<p>&nbsp;</p>
<p>This error message is displayed when the the isolated shell instance loads the wrong version of msbuild assemblies. In particular, the isolated shell&rsquo;s <strong>.exe.config</strong> file (in my specific case, my MyShellony.exe.config) was generated without some critical binding redirects for some msbuild components. Consequently, my isolated shell instance, would display the above message whenever I attempted to load an instance of my custom project type.</p>
<p>This is a known bug in the VS 2013 Isolated Shell project template.</p>
<p>To fix this issue, you will need to add the following binding redirects in the <strong>&lt;assemblyBinding&gt;</strong> section of your shell&rsquo;s <strong>.exe.config </strong>(located in the Isolated Shell project&rsquo;s &ldquo;Source Files&rdquo; folder)</p>
<p>&nbsp;</p>
<p>&nbsp;&nbsp; &lt;<span style="color: #a31515; font-family: Consolas; font-size: x-small;"><span style="color: #a31515; font-family: Consolas; font-size: x-small;"><span style="color: #a31515; font-family: Consolas; font-size: x-small;">dependentAssembly</span></span></span><span style="color: #0000ff; font-family: Consolas; font-size: x-small;"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;">&gt;<br /></span></span></span>&nbsp;&nbsp;&nbsp;&nbsp; &lt;<span style="color: #a31515; font-family: Consolas; font-size: x-small;"><span style="color: #a31515; font-family: Consolas; font-size: x-small;"><span style="color: #a31515; font-family: Consolas; font-size: x-small;">assemblyIdentity </span></span></span><span style="color: #ff0000; font-family: Consolas; font-size: x-small;"><span style="color: #ff0000; font-family: Consolas; font-size: x-small;"><span style="color: #ff0000; font-family: Consolas; font-size: x-small;">name</span></span></span><span style="color: #0000ff; font-family: Consolas; font-size: x-small;"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;">=</span></span></span><span style="font-family: Consolas; font-size: x-small;"><span style="font-family: Consolas; font-size: x-small;">"</span></span><span style="color: #0000ff; font-family: Consolas; font-size: x-small;"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;">Microsoft.Build.Framework</span></span></span><span style="font-family: Consolas; font-size: x-small;"><span style="font-family: Consolas; font-size: x-small;">" </span></span><span style="color: #ff0000; font-family: Consolas; font-size: x-small;"><span style="color: #ff0000; font-family: Consolas; font-size: x-small;"><span style="color: #ff0000; font-family: Consolas; font-size: x-small;">publicKeyToken</span></span></span><span style="color: #0000ff; font-family: Consolas; font-size: x-small;"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;">=</span></span></span><span style="font-family: Consolas; font-size: x-small;"><span style="font-family: Consolas; font-size: x-small;">"</span></span><span style="color: #0000ff; font-family: Consolas; font-size: x-small;"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;">b03f5f7f11d50a3a</span></span></span><span style="font-family: Consolas; font-size: x-small;"><span style="font-family: Consolas; font-size: x-small;">" </span></span><span style="color: #ff0000; font-family: Consolas; font-size: x-small;"><span style="color: #ff0000; font-family: Consolas; font-size: x-small;"><span style="color: #ff0000; font-family: Consolas; font-size: x-small;">culture</span></span></span><span style="color: #0000ff; font-family: Consolas; font-size: x-small;"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;">=</span></span></span><span style="font-family: Consolas; font-size: x-small;"><span style="font-family: Consolas; font-size: x-small;">"</span></span><span style="color: #0000ff; font-family: Consolas; font-size: x-small;"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;">neutral</span></span></span><span style="font-family: Consolas; font-size: x-small;"><span style="font-family: Consolas; font-size: x-small;">"</span></span><span style="color: #0000ff; font-family: Consolas; font-size: x-small;"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;"> /&gt;<br /></span></span></span>&nbsp;&nbsp;&nbsp;&nbsp; &lt;<span style="color: #a31515; font-family: Consolas; font-size: x-small;"><span style="color: #a31515; font-family: Consolas; font-size: x-small;"><span style="color: #a31515; font-family: Consolas; font-size: x-small;">bindingRedirect </span></span></span><span style="color: #ff0000; font-family: Consolas; font-size: x-small;"><span style="color: #ff0000; font-family: Consolas; font-size: x-small;"><span style="color: #ff0000; font-family: Consolas; font-size: x-small;">oldVersion</span></span></span><span style="color: #0000ff; font-family: Consolas; font-size: x-small;"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;">=</span></span></span><span style="font-family: Consolas; font-size: x-small;"><span style="font-family: Consolas; font-size: x-small;">"</span></span><span style="color: #0000ff; font-family: Consolas; font-size: x-small;"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;">2.0.0.0-4.0.0.0</span></span></span><span style="font-family: Consolas; font-size: x-small;"><span style="font-family: Consolas; font-size: x-small;">" </span></span><span style="color: #ff0000; font-family: Consolas; font-size: x-small;"><span style="color: #ff0000; font-family: Consolas; font-size: x-small;"><span style="color: #ff0000; font-family: Consolas; font-size: x-small;">newVersion</span></span></span><span style="color: #0000ff; font-family: Consolas; font-size: x-small;"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;">=</span></span></span><span style="font-family: Consolas; font-size: x-small;"><span style="font-family: Consolas; font-size: x-small;">"</span></span><span style="color: #0000ff; font-family: Consolas; font-size: x-small;"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;">12.0.0.0</span></span></span><span style="font-family: Consolas; font-size: x-small;"><span style="font-family: Consolas; font-size: x-small;">"</span></span><span style="color: #0000ff; font-family: Consolas; font-size: x-small;"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;"> /&gt;<br /></span></span></span>&nbsp;&nbsp; &lt;/<span style="color: #a31515; font-family: Consolas; font-size: x-small;"><span style="color: #a31515; font-family: Consolas; font-size: x-small;"><span style="color: #a31515; font-family: Consolas; font-size: x-small;">dependentAssembly</span></span></span><span style="color: #0000ff; font-family: Consolas; font-size: x-small;"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;">&gt;</span></span></span></p>
<p>&nbsp;&nbsp; &lt;<span style="color: #a31515; font-family: Consolas; font-size: x-small;"><span style="color: #a31515; font-family: Consolas; font-size: x-small;"><span style="color: #a31515; font-family: Consolas; font-size: x-small;">dependentAssembly</span></span></span><span style="color: #0000ff; font-family: Consolas; font-size: x-small;"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;">&gt;<br /></span></span></span>&nbsp;&nbsp;&nbsp;&nbsp; &lt;<span style="color: #a31515; font-family: Consolas; font-size: x-small;"><span style="color: #a31515; font-family: Consolas; font-size: x-small;"><span style="color: #a31515; font-family: Consolas; font-size: x-small;">assemblyIdentity </span></span></span><span style="color: #ff0000; font-family: Consolas; font-size: x-small;"><span style="color: #ff0000; font-family: Consolas; font-size: x-small;"><span style="color: #ff0000; font-family: Consolas; font-size: x-small;">name</span></span></span><span style="color: #0000ff; font-family: Consolas; font-size: x-small;"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;">=</span></span></span><span style="font-family: Consolas; font-size: x-small;"><span style="font-family: Consolas; font-size: x-small;">"</span></span><span style="color: #0000ff; font-family: Consolas; font-size: x-small;"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;">Microsoft.Build</span></span></span><span style="font-family: Consolas; font-size: x-small;"><span style="font-family: Consolas; font-size: x-small;">" </span></span><span style="color: #ff0000; font-family: Consolas; font-size: x-small;"><span style="color: #ff0000; font-family: Consolas; font-size: x-small;"><span style="color: #ff0000; font-family: Consolas; font-size: x-small;">publicKeyToken</span></span></span><span style="color: #0000ff; font-family: Consolas; font-size: x-small;"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;">=</span></span></span><span style="font-family: Consolas; font-size: x-small;"><span style="font-family: Consolas; font-size: x-small;">"</span></span><span style="color: #0000ff; font-family: Consolas; font-size: x-small;"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;">b03f5f7f11d50a3a</span></span></span><span style="font-family: Consolas; font-size: x-small;"><span style="font-family: Consolas; font-size: x-small;">" </span></span><span style="color: #ff0000; font-family: Consolas; font-size: x-small;"><span style="color: #ff0000; font-family: Consolas; font-size: x-small;"><span style="color: #ff0000; font-family: Consolas; font-size: x-small;">culture</span></span></span><span style="color: #0000ff; font-family: Consolas; font-size: x-small;"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;">=</span></span></span><span style="font-family: Consolas; font-size: x-small;"><span style="font-family: Consolas; font-size: x-small;">"</span></span><span style="color: #0000ff; font-family: Consolas; font-size: x-small;"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;">neutral</span></span></span><span style="font-family: Consolas; font-size: x-small;"><span style="font-family: Consolas; font-size: x-small;">"</span></span><span style="color: #0000ff; font-family: Consolas; font-size: x-small;"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;"> /&gt;<br /></span></span></span>&nbsp;&nbsp;&nbsp;&nbsp; &lt;<span style="color: #a31515; font-family: Consolas; font-size: x-small;"><span style="color: #a31515; font-family: Consolas; font-size: x-small;"><span style="color: #a31515; font-family: Consolas; font-size: x-small;">bindingRedirect </span></span></span><span style="color: #ff0000; font-family: Consolas; font-size: x-small;"><span style="color: #ff0000; font-family: Consolas; font-size: x-small;"><span style="color: #ff0000; font-family: Consolas; font-size: x-small;">oldVersion</span></span></span><span style="color: #0000ff; font-family: Consolas; font-size: x-small;"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;">=</span></span></span><span style="font-family: Consolas; font-size: x-small;"><span style="font-family: Consolas; font-size: x-small;">"</span></span><span style="color: #0000ff; font-family: Consolas; font-size: x-small;"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;">2.0.0.0-4.0.0.0</span></span></span><span style="font-family: Consolas; font-size: x-small;"><span style="font-family: Consolas; font-size: x-small;">" </span></span><span style="color: #ff0000; font-family: Consolas; font-size: x-small;"><span style="color: #ff0000; font-family: Consolas; font-size: x-small;"><span style="color: #ff0000; font-family: Consolas; font-size: x-small;">newVersion</span></span></span><span style="color: #0000ff; font-family: Consolas; font-size: x-small;"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;">=</span></span></span><span style="font-family: Consolas; font-size: x-small;"><span style="font-family: Consolas; font-size: x-small;">"</span></span><span style="color: #0000ff; font-family: Consolas; font-size: x-small;"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;">12.0.0.0</span></span></span><span style="font-family: Consolas; font-size: x-small;"><span style="font-family: Consolas; font-size: x-small;">"</span></span><span style="color: #0000ff; font-family: Consolas; font-size: x-small;"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;"> /&gt;<br /></span></span></span>&nbsp;&nbsp; &lt;/<span style="color: #a31515; font-family: Consolas; font-size: x-small;"><span style="color: #a31515; font-family: Consolas; font-size: x-small;"><span style="color: #a31515; font-family: Consolas; font-size: x-small;">dependentAssembly</span></span></span><span style="color: #0000ff; font-family: Consolas; font-size: x-small;"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;">&gt;</span></span></span></p>
<p>&nbsp;&nbsp; &lt;<span style="color: #a31515; font-family: Consolas; font-size: x-small;"><span style="color: #a31515; font-family: Consolas; font-size: x-small;"><span style="color: #a31515; font-family: Consolas; font-size: x-small;">dependentAssembly</span></span></span><span style="color: #0000ff; font-family: Consolas; font-size: x-small;"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;">&gt;<br /></span></span></span>&nbsp;&nbsp;&nbsp;&nbsp; &lt;<span style="color: #a31515; font-family: Consolas; font-size: x-small;"><span style="color: #a31515; font-family: Consolas; font-size: x-small;"><span style="color: #a31515; font-family: Consolas; font-size: x-small;">assemblyIdentity </span></span></span><span style="color: #ff0000; font-family: Consolas; font-size: x-small;"><span style="color: #ff0000; font-family: Consolas; font-size: x-small;"><span style="color: #ff0000; font-family: Consolas; font-size: x-small;">name</span></span></span><span style="color: #0000ff; font-family: Consolas; font-size: x-small;"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;">=</span></span></span><span style="font-family: Consolas; font-size: x-small;"><span style="font-family: Consolas; font-size: x-small;">"</span></span><span style="color: #0000ff; font-family: Consolas; font-size: x-small;"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;">Microsoft.Build.Engine</span></span></span><span style="font-family: Consolas; font-size: x-small;"><span style="font-family: Consolas; font-size: x-small;">" </span></span><span style="color: #ff0000; font-family: Consolas; font-size: x-small;"><span style="color: #ff0000; font-family: Consolas; font-size: x-small;"><span style="color: #ff0000; font-family: Consolas; font-size: x-small;">publicKeyToken</span></span></span><span style="color: #0000ff; font-family: Consolas; font-size: x-small;"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;">=</span></span></span><span style="font-family: Consolas; font-size: x-small;"><span style="font-family: Consolas; font-size: x-small;">"</span></span><span style="color: #0000ff; font-family: Consolas; font-size: x-small;"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;">b03f5f7f11d50a3a</span></span></span><span style="font-family: Consolas; font-size: x-small;"><span style="font-family: Consolas; font-size: x-small;">" </span></span><span style="color: #ff0000; font-family: Consolas; font-size: x-small;"><span style="color: #ff0000; font-family: Consolas; font-size: x-small;"><span style="color: #ff0000; font-family: Consolas; font-size: x-small;">culture</span></span></span><span style="color: #0000ff; font-family: Consolas; font-size: x-small;"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;">=</span></span></span><span style="font-family: Consolas; font-size: x-small;"><span style="font-family: Consolas; font-size: x-small;">"</span></span><span style="color: #0000ff; font-family: Consolas; font-size: x-small;"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;">neutral</span></span></span><span style="font-family: Consolas; font-size: x-small;"><span style="font-family: Consolas; font-size: x-small;">"</span></span><span style="color: #0000ff; font-family: Consolas; font-size: x-small;"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;"> /&gt;<br /></span></span></span>&nbsp;&nbsp;&nbsp;&nbsp; &lt;<span style="color: #a31515; font-family: Consolas; font-size: x-small;"><span style="color: #a31515; font-family: Consolas; font-size: x-small;"><span style="color: #a31515; font-family: Consolas; font-size: x-small;">bindingRedirect </span></span></span><span style="color: #ff0000; font-family: Consolas; font-size: x-small;"><span style="color: #ff0000; font-family: Consolas; font-size: x-small;"><span style="color: #ff0000; font-family: Consolas; font-size: x-small;">oldVersion</span></span></span><span style="color: #0000ff; font-family: Consolas; font-size: x-small;"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;">=</span></span></span><span style="font-family: Consolas; font-size: x-small;"><span style="font-family: Consolas; font-size: x-small;">"</span></span><span style="color: #0000ff; font-family: Consolas; font-size: x-small;"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;">2.0.0.0-4.0.0.0</span></span></span><span style="font-family: Consolas; font-size: x-small;"><span style="font-family: Consolas; font-size: x-small;">" </span></span><span style="color: #ff0000; font-family: Consolas; font-size: x-small;"><span style="color: #ff0000; font-family: Consolas; font-size: x-small;"><span style="color: #ff0000; font-family: Consolas; font-size: x-small;">newVersion</span></span></span><span style="color: #0000ff; font-family: Consolas; font-size: x-small;"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;">=</span></span></span><span style="font-family: Consolas; font-size: x-small;"><span style="font-family: Consolas; font-size: x-small;">"</span></span><span style="color: #0000ff; font-family: Consolas; font-size: x-small;"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;">12.0.0.0</span></span></span><span style="font-family: Consolas; font-size: x-small;"><span style="font-family: Consolas; font-size: x-small;">"</span></span><span style="color: #0000ff; font-family: Consolas; font-size: x-small;"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;"> /&gt;<br /></span></span></span>&nbsp;&nbsp; &lt;/<span style="color: #a31515; font-family: Consolas; font-size: x-small;"><span style="color: #a31515; font-family: Consolas; font-size: x-small;"><span style="color: #a31515; font-family: Consolas; font-size: x-small;">dependentAssembly</span></span></span><span style="color: #0000ff; font-family: Consolas; font-size: x-small;"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;"><span style="color: #0000ff; font-family: Consolas; font-size: x-small;">&gt;</span></span></span></p>
<p>&nbsp;</p>]]></content:encoded>
    </item>
    <item>
      <title>Managed Package Framework (MPF) for Projects released for VS 2013</title>
      <link>https://docs.microsoft.com/archive/blogs/vsx/managed-package-framework-mpf-for-projects-released-for-vs-2013</link>
      <pubDate>Wed, 11 Dec 2013 11:21:24 GMT</pubDate>
      <dc:creator><![CDATA[Ed Dore]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/vsx/2013/12/11/managed-package-framework-mpf-for-projects-released-for-vs-2013/</guid>
      <description><![CDATA[Last night the VS team uploaded a new version of MPF_Proj for VS 2013 to CodePlex, which can be used...]]></description>
      <content:encoded><![CDATA[<p>Last night the VS team uploaded a new version of <a href="https://mpfproj12.codeplex.com/" target="_blank">MPF_Proj for VS 2013</a> to CodePlex, which can be used to facilitate building custom project types for Visual Studio 2013. </p>  <p>Links to earlier versions can be found in <a href="https://blogs.msdn.com/b/vsx/archive/2012/11/15/managed-package-framework-for-projects-mpfproj-released-for-vs-2012.aspx" target="_blank">my earlier blog entry</a>.</p>]]></content:encoded>
    </item>
    <item>
      <title>Building a VSIX Deployable Single File Generator</title>
      <link>https://docs.microsoft.com/archive/blogs/vsx/building-a-vsix-deployable-single-file-generator</link>
      <pubDate>Wed, 27 Nov 2013 14:48:42 GMT</pubDate>
      <dc:creator><![CDATA[Ed Dore]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/vsx/2013/11/27/building-a-vsix-deployable-single-file-generator/</guid>
      <description><![CDATA[A recent post on the VS Extensibility Forum related to deploying a Single File Generator (also...]]></description>
      <content:encoded><![CDATA[<p>A recent post on the VS Extensibility Forum related to deploying a Single File Generator (also called a “Custom Tool”), inspired me to write a new <a href="https://code.msdn.microsoft.com/VSIX-Deployable-Single-ee39e3fe" target="_blank">VSIX Deployable Single File Generator Sample</a> to the MSDN Code gallery.</p>  <p>The existing samples were written a few releases back, and none of them take advantage of VSIX deployment. To create the new sample, I opted to create the initial project using the Visual Studio SDK’s “Visual Studio Package” project template. This ensured I ended up with the project settings and build rules that would automatically generate and include the .pkgdef to register the Single File Generator, and package it into a .VSIX file.</p>  <p>I used VS 2010 here, as I also wanted to also verify that you could build a Single File Generator with an older version of the Visual Studio tools, and then simply tweak the .vsixmanifest to target more recent versions of Visual Studio as well. If you happen to be using a newer version of VS, you can use these same steps to produce a similar project.</p>  <ol>   <li>Install the Visual Studio SDK that matches the version of VS you have installed. You can find a link to all the published versions in the <a href="https://blogs.msdn.com/b/vsx/archive/2012/11/14/welcome-to-the-vsx-arcana-blog.aspx" target="_blank">Welcome post</a> of this blog. </li>    <li>Create a new “Visual Studio Package” project, selecting C# as the language, and then removing/deselecting all other options in the project wizard.</li>    <li>Remove the VSPackage.resx, GlobalSuppressions.cs, and Guids.cs files from project.</li>    <li>Rename the xxxxPackage.cs to something more fitting your project; MyCodeGenerator.cs for example.</li>    <li>Replace the code in MyCodeGenerator.cs with something similar to the code found in the <a href="https://code.msdn.microsoft.com/VSIX-Deployable-Single-ee39e3fe/sourcecode?fileId=103699&amp;pathId=1978440340" target="_blank">SimpleFileGenerator.cs</a>.</li>    <li>Edit the source.extension.vsixmanifest to include the versions of VS you want to target.</li>    <li>Build and test in the experimental instance using F5.</li>    <li>Use the resulting .VSIX file to deploy your Single File Generator to other machines.</li> </ol>  <p>One interesting discovery made while writing this, was that you can successfully target Express versions of Visual Studio, by removing the reference to Microsoft.VisualStudio.MPF from the source.extension.vsixmanifest file. For example:</p>  <p><font size="1" face="Courier New">&#160;&#160;&#160; &lt;Reference Id=&quot;Microsoft.VisualStudio.MPF&quot; MinVersion=&quot;10.0&quot;&gt;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;Name&gt;Visual Studio MPF&lt;/Name&gt;      <br />&#160;&#160;&#160; &lt;/Reference&gt;</font></p>  <p>You’ll still see a warning during the build due to the VSIX containing non-template content. But this can be ignored, and the assembly and .pkgdef for your Single File Generator will be properly installed even for the Express SKUs you list in the .vsixmanifest. For example:</p>  <p><font size="1" face="Courier New">&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;     <br />&lt;Vsix Version=&quot;1.0.0&quot; xmlns=&quot;</font><a href="https://schemas.microsoft.com/developer/vsx-schema/2010&quot;"><font size="1" face="Courier New">https://schemas.microsoft.com/developer/vsx-schema/2010&quot;</font></a><font size="1" face="Courier New">&gt;     <br />&#160; &lt;Identifier Id=&quot;1263af09-d434-4a54-8c86-4d4000c394ab&quot;&gt;      <br />&#160;&#160;&#160; &lt;Name&gt;SimpleFileGenerator&lt;/Name&gt;      <br />&#160;&#160;&#160; &lt;Author&gt;Microsoft&lt;/Author&gt;      <br />&#160;&#160;&#160; &lt;Version&gt;1.0&lt;/Version&gt;      <br />&#160;&#160;&#160; &lt;Description xml:space=&quot;preserve&quot;&gt;Demo implementation of a Single File Generator&lt;/Description&gt;      <br />&#160;&#160;&#160; &lt;Locale&gt;1033&lt;/Locale&gt;      <br />&#160;&#160;&#160; &lt;InstalledByMsi&gt;false&lt;/InstalledByMsi&gt;      <br />&#160;&#160;&#160; &lt;SupportedProducts&gt;      <br /><strong>&#160;&#160;&#160;&#160;&#160; &lt;VisualStudio Version=&quot;10.0&quot;&gt;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;Edition&gt;Pro&lt;/Edition&gt;        <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;Edition&gt;Express_All&lt;/Edition&gt;        <br />&#160;&#160;&#160;&#160;&#160; &lt;/VisualStudio&gt;        <br />&#160;&#160;&#160;&#160;&#160; &lt;VisualStudio Version=&quot;11.0&quot;&gt;        <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;Edition&gt;Pro&lt;/Edition&gt;        <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;Edition&gt;Express_All&lt;/Edition&gt;        <br />&#160;&#160;&#160;&#160;&#160; &lt;/VisualStudio&gt;        <br />&#160;&#160;&#160;&#160;&#160; &lt;VisualStudio Version=&quot;12.0&quot;&gt;        <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;Edition&gt;Pro&lt;/Edition&gt;        <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;Edition&gt;Express_All&lt;/Edition&gt;        <br />&#160;&#160;&#160;&#160;&#160; &lt;/VisualStudio&gt;</strong>      <br />&#160;&#160;&#160; &lt;/SupportedProducts&gt;      <br />&#160;&#160;&#160; &lt;SupportedFrameworkRuntimeEdition MinVersion=&quot;4.0&quot; MaxVersion=&quot;4.0&quot; /&gt;      <br />&#160; &lt;/Identifier&gt;      <br />&#160; &lt;References/&gt;      <br />&#160; &lt;Content&gt;      <br />&#160;&#160;&#160; &lt;VsPackage&gt;|%CurrentProject%;PkgdefProjectOutputGroup|&lt;/VsPackage&gt;      <br />&#160; &lt;/Content&gt;      <br />&lt;/Vsix&gt;</font>    <br /></p>  <p>Note, this is an extremely bare boned sample, and it’s primary purpose is to illustrate how to go about leveraging the VSSDK package project to create a VSIX deployment for a Single File Generator. An internet search will turn up a good number of examples/articles on this topic. But one of my favorites was recently published by Qwertie on Code Project entitled “<a href="https://www.codeproject.com/Articles/686405/Writing-a-Single-File-Generator" target="_blank">Writing a Single-File Generator</a>”.</p>]]></content:encoded>
    </item>
    <item>
      <title>How to change solution icon in the Visual Studio Isolated Shell</title>
      <link>https://docs.microsoft.com/archive/blogs/vsx/how-to-change-solution-icon-in-the-visual-studio-isolated-shell</link>
      <pubDate>Tue, 18 Dec 2012 11:54:27 GMT</pubDate>
      <dc:creator><![CDATA[Ed Dore]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/vsx/2012/12/18/how-to-change-solution-icon-in-the-visual-studio-isolated-shell/</guid>
      <description><![CDATA[This question posted to the VS Extensibility Forum recently caught my attention. Initially, I...]]></description>
      <content:encoded><![CDATA[<p>This question posted to the VS Extensibility Forum recently caught my attention. Initially, I initially suspected this would have a simple answer, but it turns out the shell pulls this icon directly from a resource in msenv.dll.</p>  <p>After examining the underlying <a href="https://msdn.microsoft.com/en-us/library/microsoft.visualstudio.shell.interop.ivshierarchy(v=vs.110).aspx" target="_blank">IVsHierarchy</a> implementation of the root solution node, it looked like the icon could be changed by setting the <a href="https://msdn.microsoft.com/en-us/library/microsoft.visualstudio.shell.interop.__vshpropid(v=vs.110).aspx" target="_blank">VSHPROPID_IconHandle</a> property on the solution node. The next question to solve was “when” to set this. You cannot set the property from the shell stub, and package assemblies are typically loaded on demand.</p>  <p>So the best solution is to force one of your isolated shell packages to load at startup, by applying a couple of <a href="https://msdn.microsoft.com/en-us/library/microsoft.visualstudio.shell.provideautoloadattribute(v=vs.110).aspx" target="_blank">ProvideAutoLoad</a> attributes one of your VSPackage objects. Specifically:</p>  <pre>&#160;&#160;&#160; [ProvideAutoLoad(UIContextGuids.SolutionExists)]&#160;&#160;&#160;&#160; <br />    [ProvideAutoLoad(UIContextGuids.NoSolution)]</pre>

<p>Note, this is generally frowned upon in most instances. To keep startup time and memory footprint to a minimum, packages should be loaded on demand. Especially when targeting the integrated shell.&#160; But this is an isolated shell scenario, and it’s certain you’ll have to have at least one package loaded. </p>

<p>Now that we have the package configured to load at startup, we could just set the property from the package’s overridden Initialize method. But that would be a mistake. Various shell services are also implemented with packages, and there is no guarantee to the order in which packages are loaded. So we need to wait until all prescribed packages are loaded. </p>

<p>To do that, we need to wait until the <a href="https://msdn.microsoft.com/en-us/library/microsoft.visualstudio.shell.interop.__vsspropid4.aspx" target="_blank">VSSPROPID_ShellInitialized</a> property is set. And this can be done by implementing <a href="https://msdn.microsoft.com/en-us/library/microsoft.visualstudio.shell.interop.ivsshellpropertyevents.aspx" target="_blank">IVsShellPropertyEvents</a> and calling <a href="https://msdn.microsoft.com/en-us/library/microsoft.visualstudio.shell.interop.ivsshell.adviseshellpropertychanges.aspx" target="_blank">IVsShell.AdviseShellPropertyChanges</a>. </p>

<p>Below, is a slightly modified AboutBoxPackage (initially generated with the isolated shell project wizard), that I created as a quick proof of concept to verify that the solution icon can actually be changed for an isolated shell application.</p>

<p>&#160;</p>

<div id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:be38c523-e285-4c95-b139-6be192c24dd7" class="wlWriterEditableSmartContent" style="margin: 0px; padding: 0px; float: none; display: inline;">
<div style="border: #000080 1px solid; color: #000; font-family: 'Courier New', Courier, Monospace; font-size: 10pt">
<div style="background: #000080; color: #fff; font-family: Verdana, Tahoma, Arial, sans-serif; font-weight: bold; padding: 2px 5px">Code Snippet</div>
<div style="background-color: #ffffff; max-height: 500px; overflow: auto; padding: 2px 5px; white-space: nowrap"><span style="background:#ffffff;color:#0000ff">using</span><span style="background:#ffffff;color:#000000"> System;</span><br>
<span style="background:#ffffff;color:#0000ff">using</span><span style="background:#ffffff;color:#000000"> System.Diagnostics;</span><br>
<span style="background:#ffffff;color:#0000ff">using</span><span style="background:#ffffff;color:#000000"> System.Drawing;</span><br>
<span style="background:#ffffff;color:#0000ff">using</span><span style="background:#ffffff;color:#000000"> System.Globalization;</span><br>
<span style="background:#ffffff;color:#0000ff">using</span><span style="background:#ffffff;color:#000000"> System.Reflection;</span><br>
<span style="background:#ffffff;color:#0000ff">using</span><span style="background:#ffffff;color:#000000"> System.Runtime.InteropServices;</span><br>
<span style="background:#ffffff;color:#0000ff">using</span><span style="background:#ffffff;color:#000000"> System.ComponentModel.Design;</span><br>
<span style="background:#ffffff;color:#0000ff">using</span><span style="background:#ffffff;color:#000000"> Microsoft.Win32;</span><br>
<span style="background:#ffffff;color:#0000ff">using</span><span style="background:#ffffff;color:#000000"> Microsoft.VisualStudio;</span><br>
<span style="background:#ffffff;color:#0000ff">using</span><span style="background:#ffffff;color:#000000"> Microsoft.VisualStudio.Shell.Interop;</span><br>
<span style="background:#ffffff;color:#0000ff">using</span><span style="background:#ffffff;color:#000000"> Microsoft.VisualStudio.OLE.Interop;</span><br>
<span style="background:#ffffff;color:#0000ff">using</span><span style="background:#ffffff;color:#000000"> Microsoft.VisualStudio.Shell;</span><br>
<br>
<span style="background:#ffffff;color:#0000ff">namespace</span><span style="background:#ffffff;color:#000000"> MyShellony.AboutBoxPackage</span><br>
<span style="background:#ffffff;color:#000000">{</span><br>
    <span style="background:#ffffff;color:#000000">[</span><span style="background:#ffffff;color:#2b91af">PackageRegistration</span><span style="background:#ffffff;color:#000000">(UseManagedResourcesOnly = </span><span style="background:#ffffff;color:#0000ff">true</span><span style="background:#ffffff;color:#000000">)]</span><br>
    <span style="background:#ffffff;color:#000000">[</span><span style="background:#ffffff;color:#2b91af">ProvideMenuResource</span><span style="background:#ffffff;color:#000000">(</span><span style="background:#ffffff;color:#a31515">&quot;Menus.ctmenu&quot;</span><span style="background:#ffffff;color:#000000">, 1)]</span><br>
    <span style="background:#ffffff;color:#000000">[</span><span style="background:#ffffff;color:#2b91af">Guid</span><span style="background:#ffffff;color:#000000">(</span><span style="background:#ffffff;color:#2b91af">GuidList</span><span style="background:#ffffff;color:#000000">.guidAboutBoxPackagePkgString)]</span><br>
    <span style="background:#ffffff;color:#000000"></span><span style="background:#ffffff;color:#008000">// ensure package is loaded on startup</span><br>
    <span style="background:#ffffff;color:#000000">[</span><span style="background:#ffffff;color:#2b91af">ProvideAutoLoad</span><span style="background:#ffffff;color:#000000">(</span><span style="background:#ffffff;color:#2b91af">UIContextGuids</span><span style="background:#ffffff;color:#000000">.SolutionExists)]</span><br>
    <span style="background:#ffffff;color:#000000">[</span><span style="background:#ffffff;color:#2b91af">ProvideAutoLoad</span><span style="background:#ffffff;color:#000000">(</span><span style="background:#ffffff;color:#2b91af">UIContextGuids</span><span style="background:#ffffff;color:#000000">.NoSolution)]</span><br>
    <span style="background:#ffffff;color:#000000"></span><span style="background:#ffffff;color:#0000ff">public</span><span style="background:#ffffff;color:#000000"> </span><span style="background:#ffffff;color:#0000ff">sealed</span><span style="background:#ffffff;color:#000000"> </span><span style="background:#ffffff;color:#0000ff">class</span><span style="background:#ffffff;color:#000000"> </span><span style="background:#ffffff;color:#2b91af">AboutBoxPackage</span><span style="background:#ffffff;color:#000000"> : </span><span style="background:#ffffff;color:#2b91af">Package</span><span style="background:#ffffff;color:#000000">, </span><span style="background:#ffffff;color:#2b91af">IVsShellPropertyEvents</span><br>
    <span style="background:#ffffff;color:#000000">{</span><br>
        <span style="background:#ffffff;color:#000000"></span><span style="background:#ffffff;color:#0000ff">private</span><span style="background:#ffffff;color:#000000"> </span><span style="background:#ffffff;color:#0000ff">static</span><span style="background:#ffffff;color:#000000"> </span><span style="background:#ffffff;color:#2b91af">Icon</span><span style="background:#ffffff;color:#000000"> solutionIcon;</span><br>
        <span style="background:#ffffff;color:#000000"></span><span style="background:#ffffff;color:#0000ff">private</span><span style="background:#ffffff;color:#000000"> </span><span style="background:#ffffff;color:#0000ff">uint</span><span style="background:#ffffff;color:#000000"> propChangeCookie;</span><br>
<br>
        <span style="background:#ffffff;color:#000000"></span><span style="background:#ffffff;color:#0000ff">public</span><span style="background:#ffffff;color:#000000"> AboutBoxPackage() </span><br>
        <span style="background:#ffffff;color:#000000">{</span><br>
            <span style="background:#ffffff;color:#000000">solutionIcon = </span><span style="background:#ffffff;color:#0000ff">new</span><span style="background:#ffffff;color:#000000"> </span><span style="background:#ffffff;color:#2b91af">Icon</span><span style="background:#ffffff;color:#000000">(</span><span style="background:#ffffff;color:#2b91af">Assembly</span><span style="background:#ffffff;color:#000000">.GetExecutingAssembly().GetManifestResourceStream(</span><span style="background:#ffffff;color:#a31515">&quot;MyShellony.AboutBoxPackage.Resources.SolutionIcon.ico&quot;</span><span style="background:#ffffff;color:#000000">));</span><br>
        <span style="background:#ffffff;color:#000000">}</span><br>
<br>
        <span style="background:#ffffff;color:#000000"></span><span style="background:#ffffff;color:#0000ff">protected</span><span style="background:#ffffff;color:#000000"> </span><span style="background:#ffffff;color:#0000ff">override</span><span style="background:#ffffff;color:#000000"> </span><span style="background:#ffffff;color:#0000ff">void</span><span style="background:#ffffff;color:#000000"> Initialize()</span><br>
        <span style="background:#ffffff;color:#000000">{</span><br>
            <span style="background:#ffffff;color:#000000"></span><span style="background:#ffffff;color:#0000ff">base</span><span style="background:#ffffff;color:#000000">.Initialize();</span><br>
<br>
            <span style="background:#ffffff;color:#000000"></span><span style="background:#ffffff;color:#008000">// watch for VSSPROPID property changes</span><br>
            <span style="background:#ffffff;color:#000000"></span><span style="background:#ffffff;color:#2b91af">IVsShell</span><span style="background:#ffffff;color:#000000"> vsShell = (</span><span style="background:#ffffff;color:#2b91af">IVsShell</span><span style="background:#ffffff;color:#000000">)GetService(</span><span style="background:#ffffff;color:#0000ff">typeof</span><span style="background:#ffffff;color:#000000">(</span><span style="background:#ffffff;color:#2b91af">SVsShell</span><span style="background:#ffffff;color:#000000">));</span><br>
            <span style="background:#ffffff;color:#000000">vsShell.AdviseShellPropertyChanges(</span><span style="background:#ffffff;color:#0000ff">this</span><span style="background:#ffffff;color:#000000">, </span><span style="background:#ffffff;color:#0000ff">out</span><span style="background:#ffffff;color:#000000"> propChangeCookie);</span><br>
<br>
            <span style="background:#ffffff;color:#000000"></span><span style="background:#ffffff;color:#2b91af">OleMenuCommandService</span><span style="background:#ffffff;color:#000000"> mcs = GetService(</span><span style="background:#ffffff;color:#0000ff">typeof</span><span style="background:#ffffff;color:#000000">(</span><span style="background:#ffffff;color:#2b91af">IMenuCommandService</span><span style="background:#ffffff;color:#000000">)) </span><span style="background:#ffffff;color:#0000ff">as</span><span style="background:#ffffff;color:#000000"> </span><span style="background:#ffffff;color:#2b91af">OleMenuCommandService</span><span style="background:#ffffff;color:#000000">;</span><br>
            <span style="background:#ffffff;color:#000000"></span><span style="background:#ffffff;color:#0000ff">if</span><span style="background:#ffffff;color:#000000"> (</span><span style="background:#ffffff;color:#0000ff">null</span><span style="background:#ffffff;color:#000000"> != mcs)</span><br>
            <span style="background:#ffffff;color:#000000">{</span><br>
                <span style="background:#ffffff;color:#000000"></span><span style="background:#ffffff;color:#2b91af">CommandID</span><span style="background:#ffffff;color:#000000"> menuCommandID = </span><span style="background:#ffffff;color:#0000ff">new</span><span style="background:#ffffff;color:#000000"> </span><span style="background:#ffffff;color:#2b91af">CommandID</span><span style="background:#ffffff;color:#000000">(</span><span style="background:#ffffff;color:#2b91af">GuidList</span><span style="background:#ffffff;color:#000000">.guidAboutBoxPackageCmdSet, (</span><span style="background:#ffffff;color:#0000ff">int</span><span style="background:#ffffff;color:#000000">)</span><span style="background:#ffffff;color:#2b91af">PkgCmdIDList</span><span style="background:#ffffff;color:#000000">.cmdidHelpAbout);</span><br>
                <span style="background:#ffffff;color:#000000"></span><span style="background:#ffffff;color:#2b91af">MenuCommand</span><span style="background:#ffffff;color:#000000"> menuItem = </span><span style="background:#ffffff;color:#0000ff">new</span><span style="background:#ffffff;color:#000000"> </span><span style="background:#ffffff;color:#2b91af">MenuCommand</span><span style="background:#ffffff;color:#000000">(ShowAboutBox, menuCommandID);</span><br>
                <span style="background:#ffffff;color:#000000">mcs.AddCommand(menuItem);</span><br>
            <span style="background:#ffffff;color:#000000">}</span><br>
        <span style="background:#ffffff;color:#000000">}</span><br>
<br>
        <span style="background:#ffffff;color:#000000"></span><span style="background:#ffffff;color:#008000">// when shell is fully initialized, set the icon on the solution explorer&#39;s root node.</span><br>
        <span style="background:#ffffff;color:#000000"></span><span style="background:#ffffff;color:#0000ff">public</span><span style="background:#ffffff;color:#000000"> </span><span style="background:#ffffff;color:#0000ff">int</span><span style="background:#ffffff;color:#000000"> OnShellPropertyChange(</span><span style="background:#ffffff;color:#0000ff">int</span><span style="background:#ffffff;color:#000000"> propid, </span><span style="background:#ffffff;color:#0000ff">object</span><span style="background:#ffffff;color:#000000"> var)</span><br>
        <span style="background:#ffffff;color:#000000">{</span><br>
            <span style="background:#ffffff;color:#000000"></span><span style="background:#ffffff;color:#0000ff">if</span><span style="background:#ffffff;color:#000000"> (propid == (</span><span style="background:#ffffff;color:#0000ff">int</span><span style="background:#ffffff;color:#000000">)</span><span style="background:#ffffff;color:#2b91af">__VSSPROPID4</span><span style="background:#ffffff;color:#000000">.VSSPROPID_ShellInitialized &amp;&amp; </span><span style="background:#ffffff;color:#2b91af">Convert</span><span style="background:#ffffff;color:#000000">.ToBoolean(var) == </span><span style="background:#ffffff;color:#0000ff">true</span><span style="background:#ffffff;color:#000000">)</span><br>
            <span style="background:#ffffff;color:#000000">{</span><br>
<br>
                <span style="background:#ffffff;color:#000000"></span><span style="background:#ffffff;color:#008000">// set VSHPROPID_IconHandle for Solution Node</span><br>
                <span style="background:#ffffff;color:#000000"></span><span style="background:#ffffff;color:#2b91af">IVsHierarchy</span><span style="background:#ffffff;color:#000000"> solHierarchy = (</span><span style="background:#ffffff;color:#2b91af">IVsHierarchy</span><span style="background:#ffffff;color:#000000">)GetService(</span><span style="background:#ffffff;color:#0000ff">typeof</span><span style="background:#ffffff;color:#000000">(</span><span style="background:#ffffff;color:#2b91af">SVsSolution</span><span style="background:#ffffff;color:#000000">));</span><br>
                <span style="background:#ffffff;color:#000000"></span><span style="background:#ffffff;color:#0000ff">int</span><span style="background:#ffffff;color:#000000"> hr = solHierarchy.SetProperty((</span><span style="background:#ffffff;color:#0000ff">uint</span><span style="background:#ffffff;color:#000000">)</span><span style="background:#ffffff;color:#2b91af">VSConstants</span><span style="background:#ffffff;color:#000000">.</span><span style="background:#ffffff;color:#2b91af">VSITEMID</span><span style="background:#ffffff;color:#000000">.Root, (</span><span style="background:#ffffff;color:#0000ff">int</span><span style="background:#ffffff;color:#000000">)</span><span style="background:#ffffff;color:#2b91af">__VSHPROPID</span><span style="background:#ffffff;color:#000000">.VSHPROPID_IconHandle, solutionIcon.Handle);</span><br>
<br>
                <span style="background:#ffffff;color:#000000"></span><span style="background:#ffffff;color:#008000">// stop listening for shell property changes</span><br>
                <span style="background:#ffffff;color:#000000"></span><span style="background:#ffffff;color:#2b91af">IVsShell</span><span style="background:#ffffff;color:#000000"> vsShell = (</span><span style="background:#ffffff;color:#2b91af">IVsShell</span><span style="background:#ffffff;color:#000000">)GetService(</span><span style="background:#ffffff;color:#0000ff">typeof</span><span style="background:#ffffff;color:#000000">(</span><span style="background:#ffffff;color:#2b91af">SVsShell</span><span style="background:#ffffff;color:#000000">));</span><br>
                <span style="background:#ffffff;color:#000000">hr = vsShell.UnadviseShellPropertyChanges(propChangeCookie);</span><br>
                <span style="background:#ffffff;color:#000000">propChangeCookie = 0;</span><br>
            <span style="background:#ffffff;color:#000000">}</span><br>
            <span style="background:#ffffff;color:#000000"></span><span style="background:#ffffff;color:#0000ff">return</span><span style="background:#ffffff;color:#000000"> </span><span style="background:#ffffff;color:#2b91af">VSConstants</span><span style="background:#ffffff;color:#000000">.S_OK;</span><br>
        <span style="background:#ffffff;color:#000000">}</span><br>
<br>
        <span style="background:#ffffff;color:#000000"></span><span style="background:#ffffff;color:#0000ff">private</span><span style="background:#ffffff;color:#000000"> </span><span style="background:#ffffff;color:#0000ff">void</span><span style="background:#ffffff;color:#000000"> ShowAboutBox(</span><span style="background:#ffffff;color:#0000ff">object</span><span style="background:#ffffff;color:#000000"> sender, </span><span style="background:#ffffff;color:#2b91af">EventArgs</span><span style="background:#ffffff;color:#000000"> e)</span><br>
        <span style="background:#ffffff;color:#000000">{</span><br>
            <span style="background:#ffffff;color:#000000"></span><span style="background:#ffffff;color:#2b91af">AboutBox</span><span style="background:#ffffff;color:#000000"> aboutBox = </span><span style="background:#ffffff;color:#0000ff">new</span><span style="background:#ffffff;color:#000000"> </span><span style="background:#ffffff;color:#2b91af">AboutBox</span><span style="background:#ffffff;color:#000000">();</span><br>
            <span style="background:#ffffff;color:#000000">aboutBox.ShowModal();</span><br>
        <span style="background:#ffffff;color:#000000">}</span><br>
    <span style="background:#ffffff;color:#000000">}</span><br>
<span style="background:#ffffff;color:#000000">}</span></div>
</div>
</div>]]></content:encoded>
    </item>
  </channel>
</rss>