Managing Vsix Deployments with Powershell

tl;dr – VsixTools fixes the ‘Invalid Multiple Files in VSIX’ issue on the Visual Studio Gallery and lets you set vsix version numbers with Powershell.

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.

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.

Add more than one project template to your Vsix and try and upload it – this is what you’ll see:


It’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’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.

Enter VsixTools, 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:

# Load vsix tools
. VsixTools.ps1
# Set the version number of 'MyPackage' and fix the zip issue for uploading to the gallery.
$vsixPath = "c:/MyPackage.vsix"
Vsix-SetVersion -VsixPath $vsixPath -Version ""
Vsix-FixInvalidMultipleFiles -VsixPath $vsixPath

This Powershell script has no dependencies, it’s just Powershell 2.0. Get the script at github.com/dwmkerr/vsix-tools.

It works for package manifests of version 1 or 2 – for anyone who’s lucky enough to have not had to delve into the internals of this that means that it works from Visual Studio 2010 onwards.


Practical AngularJS Part 2

I’m going to be working in F# almost exclusively for a short while, so before I throw myself into that I wanted to wind up my Practical AngularJS Part 2 article. It’s ready to rock here:

Practical AngularJS Part 2 – Components of an AngularJS Application

In this article we get a brief introduction to what’s in the toolkit for an angular developers – filters, controllers, services, directives, views and routes. I don’t go into too much detail, we’re just seeing what the different components are. Spread the word, share the article and as always, comments are welcome.


Langton’s Ant in Javascript

Langton’s Ant is a great simulation to write to play with a language. Just today I’ve completed my Langton’s Ant write up and published it on the CodeProject, you can see the article at Learn JavaScript Part 3 – Angularjs and Langton’s Ant.

Langton's Ant

There are some interesting things in the article for angular too – a look at using directives for custom elements, how to handle both the DOM and Angular loading correctly, and timers and intervals. This is the third part on my series on Learn Javascript, the next will focus on NodeJS. Enjoy, share, fork and comments are always welcome.

The default configuration of the simulation is interesting – try a simulation of the form ‘left, left, right, right’ for another type of behaviour.


A great read for JavaScript newcomers

A superb article by Colin Eberhardt has just been published on the CodeProject, called ‘Understanding JavaScript Object Creation Patterns’.

This article should be on the reading list of anyone who’s new to JavaScript or not familiar with how objects and prototypes work. It takes you step by step through the basics all the way to protoypes and classes.

The article is at:


I’d strongly recommend it!


Practical AngularJS

I was recently at Devoxx in Antwerp, primarily because I wanted to get involved in some of the sessions that were being hosted by guys from the AngularJS team at Google. I’ve had a chance to work a little with Backbone and KnockoutJS and had been recently deliberately holding off looking at AngularJS so I could hit the conference and workshops fresh and unencumbered with any preconceptions.

The sessions were great, and since then I’ve been working on a couple of projects that use Angular. As I’ve always found writing about a topic a great way to really cement what you know about it, and to understand where the holes in your knowledge are, I’ve started a new series of articles called ‘Practical AngularJS‘.



This series is a little different to others I’m working on at the moment (such as the seemingly endless SharpShell articles and Learn JavaScript which is taking some time) as I’m writing it on my own blog rather than on the CodeProject. The reason behind this is purely push me into getting better at handling my blog (particularly the code samples) and because the code I’m writing doesn’t need to be associated with download links and so on, it can all be in fiddles.

Anyway, enough chatter – part one of Practical AngularJS is now finished. It’s a new series, so it’s early enough to have a say in where it goes, please comment and share and let me kn0w whether you find it useful, pointless, or anything in-between.

As a short teaser, in Practical AngularJS Part 1 – Introducing AngularJS we take a look at what AngularJS is, why we’d consider using it and when. We start out with a trivial task for a web application, and see how it quickly becomes a bit sluggish and painful to do certain things, then see how using AnguarJS can ease that pain, letting us focus on the important stuff and it help out with the grunt work. We take our initially messy app and make it a lot more manageable, and look into how we can with our new structure start to write unit tests for the logic.

So this is the bulk of Part 1. Unless there’s a strong push for another topic, Part 2 will focus on testing. Testing is core to the development ideals of the AngularJS project and is something that it was built in mind for. We’ll look into how quickly we can write unit tests, and the flexibility that we’ve got.

Rather than advocating patterns such as BDD or TDD, we’ll again shy away from theoretical discussions about what is conceptually the best paradigm and just dig in – playing with the code and seeing what works and what doesn’t. By the end of it you’ll have a good idea of the freedom you’ve got with testing – leaving it up to you to choose the pattern or process that fits your style, or the style of your team and project the best.


Space Invaders on the CodeProject

I’m currently writing a series of articles on the CodeProject called ‘Learn JavaScript’ and am pleased to say that the latest article is available now!

Learn JavaScript Part 2 – Space Invaders

In this article we take a look at how to create the classic space invaders game with plain JavaScript and HTML – no libraries or frameworks. You can see it in action on the page experiments/spaceinvaders. Check it out – as always, comments are welcome!



SharpShell 2.0

I have just released SharpShell 2.0  - you can get the release from sharpshell.codeplex.com or the new GitHub page at github.com/dwmkerr/sharpshell.

This release has been primarily a bugfixing release, but there is one very useful new feature, the Server Registration Manager tool (srm.exe). This is a standalone application that can be used to install and uninstall SharpShell servers.

srm install server.dll -codebase

srm uninstall server.dll

This tool makes it much easier to deploy SharpShell servers. You can call the tool as a Custom Action in a MSI project, either by using Visual Studio 2010′s installer project type, or a WiX project. I’ll be writing up an article on the CodeProject on how to use the tool soon, until then you can download the tool and try it out now!


ConsoleControl and Happy Coders

Sometimes I write up an article and some code on the CodeProject and get a good response, other times it seems an article sinks beneath the waves without any notice. Looking over some emails the other day, I noticed that my ConsoleControl article had actually received a slow and steady response of extremely positive feedback – people are using it and suggesting improvements.


This is great, it’s one of the things I love about the community of developers that I’m part of. So I decided to try and put a bit more back with ConsoleControl. I’ve moved the source code to GitHub, so that anyone can fork it and work on it easily:


I’ve bulked out the readme.md file with some more information and am working in the documentation. I’ve also added ConsoleControl to Nuget – you can install it for WinForms or WPF with the commands below:

PM> Install-Package ConsoleControl

PM> Install-Package ConsoleControl.WPF

Finally, I’m blogging about it here. It’s great to see people using a project like this, it’s rare for me to share comments like the ones below, but I must say I was touched by:

This is just about borderline genius. - Gerben Rampaart
Brilliant. So easy to use and works flawlessly. - Sukar
I saw similar controls – but yours is outstanding – I love it! BTW: Very nice coding (style, comments) – 5ed! - johannesnestler

To finish off this post, I’d like to say thanks to everyone who’s commented, suggested improvements and shared their experiences with the code, it’s a great feeling when you share something and it seems that people benefit from it. If you’ve used the code and want to share ideas for improvements or feedback, email, comment or hit the GitHub page or CodeProject article.


Space Invaders in JavaScript

If you take a look at the Experiments Page you’ll see that there’s a new entry – Space Invaders.


Space Invaders is a great little game to code if you’re learning a new language or technology (and JavaScript is still very much in that category for me). I’ll be writing up how I made the game on the CodeProject soon enough (if you’re interested you can see how I made the starfield background in JavaScript).

You can check back periodically – the game is nearly done and more than ready to play with. The code is available as well, either just get it from the browser or check Space Invaders on GitHub. I’ll post when it’s done and the next experiment starts!


Introducing Experiments

I’m staring a series of articles on learning Javascript (the first is available at http://www.codeproject.com/Articles/642499/Learn-JavaScript-Part-1-Create-a-Starfield). To help with this, I’ve created the Experiments page. This page will host each of the things I’ve been playing with in the process of learning JavaScript and coming up with good topics for tutorials.

You can see the Experiments page here, there’s also a link at the top of the site. If you like it, please feel free to comment on this post or get in touch.