And Now ChocolateyCoolWhip

Following up on CoolWhip, ChocolateyCoolWhip is a nuget package that makes creating, packaging, and deploying your code through simple.  Like CoolWhip, all you need to do to publish a new release is create release in GitHub.



In case you aren’t familiar, Chocolatey is a package manager for Windows built on top of NuGet and PowerShell. It allows users to download and install thousands of software programs with a single command.  For example, to install nodejs, all you would need to do is open up a command prompt and enter

> choco install nodejs.install

Getting Started with ChocolateyCoolWhip

To get started, install the nuget package into your project.  The first thing you’ll notice is that it creates nuspec and AppVeyor configuration files.  Chocolatey uses the nuspec as metadata for your package, the same way NuGet does.

Once setup, all you need to do to update your package on is create a release in GitHub.  ChocolateyCoolWhip will pull the version information directly from the release name and kick off a build in AppVeryor.  You have complete control over versioning your application

Configuration is simple:

  1. Connect AppVeyor to your GitHub repo
  2. Install the NuGet package >Install-Package ChocolateyCoolWhip
  3. Update the generated nuspec file with your project’s information
  4. Add your authorization tokens to the AppVeyor.yml file
  5. Save/commit your changes

Once this is set up, all you’ll need to do in order to release (or update) your package on NuGet is create a GitHub release with the version number.

There is full step by step documentation in the wiki.

Happy Coding.

Introducing CoolWhip

CoolWhip is a NuGet package aimed at making and deploying other NuGet packages easier. With CoolWhip, creating a Release in GitHub automatically pushes that release to NuGet.


Once you’ve installed CoolWhip into your project it will create a nuspec file and AppVeyor configuration file.  These will work together to package your project and automatically upload it to

Once setup, all you need to do to update your package on is create a release in GitHub.  CoolWhip will pull the version information directly from the release name and kick off a build in AppVeryor.  You have complete control over versioning your application.

To configure CoolWhip you need to

  1. Connect AppVeyor to your GitHub repo
  2. Install the NuGet package >Install-Package CoolWhip
  3. Update the generated nuspec file with your project’s information
  4. Add your authorization tokens to the AppVeyor.yml file
  5. Save/commit your changes

Once this is set up, all you’ll need to do in order to release (or update) your package on NuGet is create a GitHub release with the version number.

There is full step by step documentation in the wiki.

Happy Coding.


Source on GitHub

Package on NuGet

Treat Warnings as Errors In TeamCity

I’m OCD when it comes to my code.  I don’t like to have any warnings.  I wanted to configure my TeamCity builds to fail if there were any warnings in the projects. My first option is to tick the “Treat warnings as errors” box in the project settings.  This had a few problems

Problem 1.

I’d have to remember to do it for every project in my repo, including all the projects I make in the future.  Even worse, everyone on my team would have to remember to do that too.  That’s not something I could rely on.

Problem 2. 

While warnings are just errors that you’re ignoring, I will admit that it is convenient to be able to ignore some things some times.  I’m fine with debugging and running locally with some errors.  I really only wanted to stop people from committing code back to master with warnings.  I couldn’t care less about bad hygiene the have when working locally.

The Solution

In searching, I found David Gardiner’s blog post in which he creates a power shell script to edit the xml in each csproj file.  It looks simple enough so I removed the TFS bit and added it as a build step in my TeamCity flow. It runs right before compiling my code.


Get-ChildItem -Recurse -Filter "*.*csproj" | % {
    Write-Host $_.Name
    $filename = $_.Fullname
    $proj =
( Get-Content $_.Fullname ) $xmlNameSpace = new-object System.Xml.XmlNamespaceManager($proj.NameTable) $xmlNameSpace.AddNamespace("p", "") $nodes = $proj.SelectNodes("/p:Project/p:PropertyGroup[@Condition and not (p:TreatWarningsAsErrors)]", $xmlNameSpace) $touched = $false $nodes | ForEach-Object -Process { $e = $proj.CreateElement("TreatWarningsAsErrors", "") $e.set_InnerText("true") $_.AppendChild($e) | Out-Null $touched = $true } if ($touched) { Write-Host "Checkout $filename" $proj.Save("$($filename)") | Out-Null } }

Chrome Debugging API

TL;DR – C# Chrome Developer Tools API

While, I was hunting for some SEO tools related to page loading performance, I stumbled on something that I heard about, but never saw with my bare eyes – the Chrome Debugger Protocol.  While the website would lead you to believe the protocol is fairly thin, think again.  The protocol is much more exhaustive.  The protocol is used by the Chrome Developer Tools.  So everything you see in this window, you can interact with.

Chrome Developer Tools - Network


This is available via a WebSockets endpoint over which JSON commands and events are sent.  While this is great (seriously, this is really cool stuff by Chrome), I’m a C# guy.  So, I did what any rational human would do – I wrote a parser to generate C# objects for every command and event in the protocol.  Then, I packaged that up with some classes to enable Chrome debugging and send/receive messages.  I adding in a small sample, put it up and GitHub and, well … have fun!

Here’s a small example of how to use the library in C#:

using MasterDevs.ChromeDevTools;
    chromeSession.Subscribe<Protocol.Page.DomContentEventFiredEvent>(domContentEvent =>
        System.Console.WriteLine("DomContentEvent: " + domContentEvent.Timestamp);

    chromeSession.SendAsync(new NavigateCommand
        Url = ""

The protocol is pretty extensive.  You can checkout the protocol.json file, which defines the events, commands, parameters, and more right here.  You can find a description of how the Chrome Debugger Protocol works, along with all the code, up in the MasterDevs repository ChromeDevTools.

I really hope you use it, enjoy it, let me know if there are issues, and, most importantly, let me know what you build with it!

ILRepack – E Pluribus Unum: One assembly from many

Sometimes it is just much easier to deploy a single assembly that includes all dependencies.  ILRepack and ILRepack.MSBuild.Task will do just that for you.  Since I like to have Visual Studio and my build environment do this for me, I went with ILRepack.MSBuild.Task.

The Sample

In order to showcase packing an assembly into my program, first I need a program that has a dependency.  I decided to go with a simple console app that has a dependency on the Humanizer NuGet package to tell you how long you have to wait until your birthday. 

Usage:   repack [date]
  Prints how long it is until your birthday.
  If you don't supply your birthday, it uses mine.

23 weeks until your birthday

I created a new console project in Visual Studio and named it Repack.  I then included the Humanizer DLL using the NuGet package manager. 

You can find the source code on github.

Using ILRepack

All you need to do is add the following snippet at the end of your .csproj file.  To do this, you can open up the .csproj file in notepad or your favorite text editor.

<Target Name="AfterBuild" Condition="'$(Configuration)' == 'Release'">

  <InputAssemblies Include="$(OutputPath)\$(AssemblyName).exe" />
  <InputAssemblies Include="$(OutputPath)\*.dll" />


Because we name the target “AfterBuild”, this code will automatically be run after msbuild or Visual Studio builds our project.  Setting the condition ensures that this will only run when we are in release mode.  You can definitely run this on debug builds, but it’s less likely that you’d want to.

The ItemGroup specifies lets us create a list of assemblies to include in the package.  The first assembly should be your assembly.  In my example it will be my executable file “Repack.exe”.  Next, I include all the DLLs in the output directory.  This way, if I add a new dependency later, it will be included automatically.

Note that the order does matter.  You will want to put the .exe first in this list.

Next all we need to do is call ILRepack.  You can specify the output file to be anywhere you like, but in this example I overwrite the existing Repack.exe with the packed version.

Once you rebuild your project (in release mode), you can copy the EXE anywhere you want and it will run. 


ILRepack.MSBuild.Task let’s you package DLL’s into your EXE file so you can copy just the executable anywhere and not have to worry about deploying the dependencies as well.

Full sample code can be found on github.

Happy coding.

Convert Azure Publish Profiles to FileZilla config files

Occasionally I need to FTP into one of my Azure websites.  Sometimes it’s to look at the logs; other times to upload a few files.  Just about every time I go to do this, I realize that I don’t know the credentials.  So I go and download the publish profile and open it up in my favorite text editor to get the FTP information and manually enter that in FileZilla.

I quickly became tired of doing this, so I wrote a console app that will do it for me.  The source code and executable are available on my GitHub.


  1. Download your publish profile
  2. Run the command line tool
  3. Import the config file to FileZilla

Download your publish profile

Log on to the Azure management portal for the website you want to FTP into.  On the right side of the dashboard page you will see an option to “Download the publish profile.”  Click it and you’re on your way.


When downloaded the file will look something like this:

<?xml version="1.0" encoding="utf-8" ?>
    profileName="TestSite - Web Deploy"
    userPWD="test password"
    profileName="TestSite - FTP"
    userPWD="test password"

Obviously, all the pertinent connection information has been scrubbed clean.  But you get the idea.

Run the command line tool

Next thing you need to do is run pubToFz.exe to convert the publish profile into a format that FileZilla understands.  Assuming the default download location, the command would look like this:

pubToFz %home%\downloads\testSite.publishProfile

By default, the tool creates an file named FileZilla.xml in the current directory.  The file will look something like this.

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
      <Pass encoding="base64">base 64 encoded test password</Pass>
      <Comments />
      <LocalDir />
      <RemoteDir />

Again, this was scrubbed clean.

Import the config file to FileZilla

Now all you have to do is open up FileZilla and import the config file that you just saved.


F8 in CMD: The Greatest Thing Since Sliced Bread

I recently stumbled across DOSKEY while reading StackOverflow.  Reading the documentation I stumbled across something old and something new.


F7    Displays command history
F8    Searches command history

I knew about F7 and use it constantly when I’m on the command line.  It pops up a scrollable list of your recent commands.


F8 lets you cycle through commands in your history with a search term.

Suppose you had previously typed a complex command.  In the example I have below, I used the command “echo Foxtrot Golf”.  To find and execute it again all you need to do is type the beginning of the command and then press the F8 key.  In the example, I type “echo” on the command prompt and cycle through all the commands that start with that by pressing F8.  To narrow it down a bit more, I type in “echo F” and then press F8 to get all the commands that start with that.  Note that it is case sensitive.


Debugging a Visual Studio Crash

After a recent reboot, Visual Studio just stopped working.  Whenever I clicked on the icon on my desktop, I’d see this:


When the obvious solution (restarting my computer) I had to dig a little deeper.

Step 1:  Logs

The first step is to get some more information.  You can tell Visual Studio to log at startup by passing it the /log parameter on the command line.  Now, I’m fairly comfortable with the command line, but I rarely ever use it to start up Visual Studio.

An easier way is to just use the Diagnostic Mode option in the jump list.  Right click on the Visual Studio icon in your taskbar and select Diagnostic Mode.


Now all I had to do was wait for Visual Studio to crash again.  To get to the logs right click on the Visual Studio icon again select Open Activity Log Location.  With my setup, this opened C:\Users\Josh\AppData\Roaming\Microsoft\VisualStudio\12.0.  The log file is ActivityLog.xml.

In the log just search for a line like


Hopefully, there aren’t too many of them.  In my case it pointed to a missing DLL

    <time>2015/01/26 21:26:02.821</time>
    <description>Could not load file or assembly &apos;GettingStartedSetup.dll&apos; or one of its dependencies. The system cannot find the file specified.</description>

I went to the folder specified and verified that the DLL was missing.  Next thing to do is open up the extension.vsixmanifest to determine which extension it was.  Looking at the DisplayName node, it was fairly clear that it was Release Management tools for Visual Studio 2013.

<PackageManifest Version="2.0.0" xmlns="">
    <Identity Id="9b4bef8e-2ac3-4fa8-b8c7-d93d73d3618b" Version="2.2" Language="en-US" Publisher="Microsoft" />
    <DisplayName xml:space="preserve">Release Management tools for Visual Studio 2013</DisplayName>
    <Description xml:space="preserve">Release Management tools for Visual Studio helps to quickly get started with creating a Release Definition to automate the deployment of your application to multiple stages. You start with a working Build definition and then using this tool, set up a release pipeline that enables triggering of a Release for each build that is available for the build definition.</Description>

Step 2:  Safe Mode

Now that I know which extension was misbehaving, all I needed to do was uninstall it.

Open up Visual Studio in safe mode.  This can be done with a command line switch or through the jump menu again.


Visual Studio should open w/out a problem.  From here, it’s easy sailing.  Open up the Extensions and Updates tool, find the problematic extension in the Installed list, and press the uninstall button.


Now I was able to restart Visual Studio and it worked just fine.  I could have re-installed the extension, but I didn’t really need it so I just left it uninstalled.

Genymotion Android Emulator

I like to use an emulator to debug my android apps.  My emulator of choice is the Genymotion emulator.  It’s much easier to install and use than the one in the android-sdk.

One drawback I have seen with it it, is that sometimes it just refuses to start.  Getting it to start back up isn’t hard, but it isn’t all that unintuitive.

Try Try Again

The first thing to try is to just restart the emulator a few more times.  It might just work the third or fourth time.  You don’t have to restart the entire Genymotion console, just hit the start button and wait for the emulator to succeed or fail.  Try this a few times and you might just get lucky.

Delete Network Settings

If you’ve tried a few times and still don’t have any success you can force Genymotion to reconfigure its network settings.


  1. Open up Oracle VM Virtual Box manager
  2. Go to Preferences
  3. Go to the Network tab
  4. Delete the VirtualBox Host-Only Ethernet Adapter
  5. Start up the emulator as normal


Open up the Oracle VM Virtual Box manager.  I do this by typing any part of the name that I happen to remember at the time into my start menu.


VirtualBox is what powers the emulator, so you will see all of your android images listed.  Go to File –> Preferences


Then click on Network on the right.


You should see “VirtualBox Host-Only Ethernet Adapter” in the “Host-only Networks”.  Select it and click the delete button on the right (it’s the button in the middle)


Now, go back to Genymotion and try to start the emulator again. It will notice that the virtual network adapter is missing and recreate it. You may see a UAC prompt asking if VirtualBox should be allowed to make changes to your computer.  Click yes.

Your emulator should now startup.

Creating Drawables for Android

One of the pains for Android development for me is creating drawables in different sizes for various devices. In the past I’d only have a few images at a time to resize so I’d normally just upload them to Android Asset Studio and have the site generate the correct sizes for me.

There are two problems with this approach.  First, I have to upload the files one at a time.  If I have more than 4 files then it becomes a bit of a chore.  Second, I can’t specify what size I want the output.  It always  generates files that are

mdpi 32×32 pixels
hdpi 48×48 pixels
xhdpi 64×64 pixels
xxhdpi 96×96 pixels

Instead of manually editing the images I had (I had a lot) I decided to finally just write an app to handle this for me.  You can find it on GitHub at AndroidIconsResizer.  Right now it is a little barebones but it quickly and easily handles batches of images.

All options are optional so the simples use is to just run it.  If nothing is specified it assumes the current directory for all input or output.  By default the output images are all squares and are 100×100 at the mdpi size.

> AndroidIconResizer

It looks for all the .png files in current directory, resizes them and copies them to the appropriate output directories.  If you ran the above command in the following directory


then the directory would look like this after

        file.png (100 x 100 pixels)
        anotherFile.png (100 x 100 pixels)
        file.png (150 x 150 pixels)
        anotherFile.png (150 x 150 pixels)
        file.png (200 x 200 pixels)
        anotherFile.png (200 x 200 pixels)
        file.png (300 x 300 pixels)
        anotherFile.png (300 x 300 pixels)

It is possible to specify different sizes (heights and widths) for the output images.  All you need to specify is the size you want the mdpi image.  The other sizes are extrapolated based on Google’s iconography recommendations.

> AndroidIconResizer –w 20 –h 50

You can specify the input and output directories just as easily

> AndroidIconResizer –i inputDir –o outputDir

By default the xxxhdpi image isn’t generated since it’s only needed for launcher icons.  You can choose to include it with an option

> AndroidIconResizer –-include-xxxhdpi

Or you can just ask the tool itself for some help:

> AndroidIconResizer –help

Those were all the features I needed today, but I’ll probably be expanding on this app in the future.  Let me know if you’d want any other features.

Happy Coding.