<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Visual Studio Extensibility on dwmkerr.com</title><link>https://dwmkerr.com/categories/visual-studio-extensibility/</link><description>Recent content in Visual Studio Extensibility on dwmkerr.com</description><generator>Hugo -- gohugo.io</generator><language>en-uk</language><managingEditor>Dave Kerr</managingEditor><copyright>Copright &amp;copy; Dave Kerr</copyright><lastBuildDate>Sun, 30 Mar 2014 11:40:16 +0000</lastBuildDate><atom:link href="https://dwmkerr.com/categories/visual-studio-extensibility/index.xml" rel="self" type="application/rss+xml"/><item><title>Managing Vsix Deployments with Powershell</title><link>https://dwmkerr.com/managing-vsix-deployments-with-powershell/</link><pubDate>Sun, 30 Mar 2014 11:40:16 +0000</pubDate><guid>https://dwmkerr.com/managing-vsix-deployments-with-powershell/</guid><description>&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;tl;dr&lt;/strong&gt; - &lt;a href="https://github.com/dwmkerr/vsix-tools"&gt;vsix-tools&lt;/a&gt; fixes the &amp;lsquo;Invalid Multiple Files in VSIX&amp;rsquo; issue on the Visual Studio Gallery and lets you set vsix version numbers with Powershell.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;I maintain a reasonably large project called SharpGL. This project contains two Vsix packages (Visual Studio Extensions), each of which contains project templates for Visual Studio.&lt;/p&gt;
&lt;p&gt;If you have ever worked with Vsix files before you might have noticed that the tools for them in Visual Studio seem a little flaky - but even more so is that Visual Studio Gallery site that you have to use to upload your extensions.&lt;/p&gt;
&lt;p&gt;Add more than one project template to your Vsix and try and upload it - this is what you&amp;rsquo;ll see:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.dwmkerr.com/wp-content/uploads/2014/03/InvalidMultipleZipFilesInVsix.jpg"&gt;&lt;img src="images/InvalidMultipleZipFilesInVsix.jpg" alt="InvalidMultipleZipFilesInVsix" width="263" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;It&amp;rsquo;s a pain to solve this problem - basically you need to change the folder structure within the vsix file, then change the xml that describes it. Now this is not too much of a problem if you do it once or twice, but if you&amp;rsquo;re in the situation where you want to be able to build a release of your code rapidly, including extensions, this will seriously slow you down.&lt;/p&gt;
&lt;p&gt;Enter &lt;a href="https://github.com/dwmkerr/vsix-tools"&gt;VsixTools&lt;/a&gt;, a little Powershell script that lets you resolve this issue and as a bonus lets you set the version in the Vsix as well - very useful for scripts that build releases. You can use it like this:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;# Load vsix tools
. VsixTools.ps1
# Set the version number of &amp;#39;MyPackage&amp;#39; and fix the zip issue for uploading to the gallery.
$vsixPath = &amp;#34;c:/MyPackage.vsix&amp;#34;
Vsix-SetVersion -VsixPath $vsixPath -Version &amp;#34;2.2.0.1&amp;#34;
Vsix-FixInvalidMultipleFiles -VsixPath $vsixPath&amp;lt;/pre&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This Powershell script has no dependencies, it&amp;rsquo;s just Powershell 2.0. Get the script at &lt;a href="https://github.com/dwmkerr/vsix-tools"&gt;github.com/dwmkerr/vsix-tools&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;It works for package manifests of version 1 or 2 - for anyone who&amp;rsquo;s lucky enough to have not had to delve into the internals of this that means that it works from Visual Studio 2010 onwards.&lt;/p&gt;</description><category>CodeProject</category></item><item><title>WPF and Visual Studio Addins</title><link>https://dwmkerr.com/wpf-and-visual-studio-addins/</link><pubDate>Wed, 12 Jun 2013 01:36:18 +0000</pubDate><guid>https://dwmkerr.com/wpf-and-visual-studio-addins/</guid><description>&lt;p&gt;If at all possible nowadays, I write all my Windows UI code in WPF, it&amp;rsquo;s just quicker and easier than WinForms. Recently however, I came across a situation that you should just avoid.&lt;/p&gt;
&lt;p&gt;If you&amp;rsquo;re developing addins for multiple versions of Visual Studio - don&amp;rsquo;t use WPF for the Tools &amp;gt; Options windows. It&amp;rsquo;s just noit going to place nice out of the box. This is because there&amp;rsquo;s a lot of property page Win32 stuff going on in the host window that makes it hard to route messages properly - keyboard entry won&amp;rsquo;t work correctly, tab order will be messed up and more, it&amp;rsquo;s just not worth the pain.&lt;/p&gt;
&lt;p&gt;If you&amp;rsquo;re developing addins for later versions of Visual Studio, you can actually use the VSPackage functionality to build options pages with WPF with ease, just check &lt;a href="http://msdn.microsoft.com/en-us/library/microsoft.visualstudio.shell.uielementdialogpage.aspx" target="_blank"&gt;UIElementDialogPage&lt;/a&gt;. In fact, read the article here:&lt;/p&gt;
&lt;p&gt;&lt;a title="Creating Option Pages by using MPF" href="http://msdn.microsoft.com/en-us/library/bb165039.aspx" target="_blank"&gt;Creating Options Pages by using MPF &lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Final thoughts on this - if you want the functionality above in VS2010, you can get it (as long as you use MPF) by checking this page:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://social.msdn.microsoft.com/Forums/en-US/vsx/thread/6af9718e-8778-4233-875d-b38c03e9f4ba" target="_blank"&gt;Unable to access WPF User Control in Options Dialog&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;You&amp;rsquo;ll see that about halfway down, Ryan Moulden has posted some code from Microsoft for the UIElementDialogPage, you can use that you get the functionality in VS2010.&lt;/p&gt;
&lt;p&gt;Any other versions, or for a addin installed by an MSI, it&amp;rsquo;s probably best to stick with WinForms.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;</description><category>CodeProject</category></item></channel></rss>