Synchronize Node.JS Install Version with Visual Studio 2015


Visual Studio 2015 is out for download now (and free for individual use)!  It’s been so great to have integrated Grunt and Gulp support, and ES6+ features.  In addition, Visual Studio 2015’s installer has an option to install Node.JS as part of its regular install in order to support the Gulp and Grunt task runners that are built in.  However I ran into an issue today in which I updated Node.JS outside of Visual Studio, but since VS uses its own install that is separate from any outside installation, you can potentially run into a node_modules package dependency issue where one version of npm installs a package (which makes it rely on that version of Node/npm), and then you can’t run commands in the other version (they break).  Specifically, I had an issue with node-sass and windows bindings.  The solution was to point Visual Studio to the version of Node.JS that I had already set up externally to Visual Studio.  Here’s how to synchronize them: Continue reading…

NServiceBus: Could not enumerate all types


I’ve recently started using NServiceBus for the first time in a long time.  The initial setup was great, but once I started integrating it into a really large, complex, existing app, it took a bit of re-working.  One of the errors I ran into was a HUGE string of errors all centering around not being able to enumerate all types.  In this case, the root cause turned out to be NServiceBus scanning every single .dll of your app looking for handlers.  By default, it searches everything, and when that happens it can run into situations where it can break.  The out of the box, greenfield developer experience works great, but if you’re adding NServiceBus to an existing app, then you need to add the line below to fix the error.

Basically in an existing app where you’ve added NServiceBus code to handle/send messages, then you know exactly the assembly where it lives.  Again, by default, NServiceBus scans everything, so in NServiceBus 5.0 and above, when you create the actual Bus object, you need to specify in the configuration the assemblies you want to scan.  Generally, the code is going to be in right int he webapp/console app that you are adding it to, so in that case just add:

var config = new BusConfiguration();

// config.AllYourOtherConfigurationGoesHere


var bus = Bus.Create(config);

This tells NServiceBus to only scan the assembly that is currently in use (This will fix things 95% of the time, unless your comsumer/sender code is in a different project and pulled in).  Once this is configured, NServiceBus will not scan every single assembly in hopes of finding a handler somewhere, which helps a ton if you have really old assemblies that are fragile and busted.  :)

Ghost VS WordPress (and Why I Migrated Back to WordPress)

Ghost Migrating to Wordpress

A few weeks ago I decided to hop on the Ghost train.  Ghost is a blogging engine, written in Node.js (JavaScript) and is only a little over a year old now, but has a huge backing for how young it is.  In general, there’s a ton of hype around new tools and frameworks in the development community, and this is no different.  I’ve had my blog on WordPress since the beginning, so I decided to run an experiment for a bit and get an objective answer as to which is better for me and document my experiences, so here we go.  Let’s compare Ghost VS WordPress! Continue reading…

Redirect WWW to Non-WWW using the Web.config

By now, most people know that websites’ SEO is dinged by Google when there is both a www and non-www url with the same content on both. Google (and Bing) treat them as two separate sites and they fight for pagerank as everyone else blows your two competing sites out of the water. I’ve had redirects set up on my WordPress blog for the past 4 years, which is pretty easy to do, but I recently moved my blog over to Ghost blogging engine and since it’s currently at version 0.5, it didn’t have this 301 redirect functionality built in, so I needed to roll my own. Since I was moving to Azure Websites, I needed to add a redirect to get this fixed in the web.config, so I thought I’d share it with you! 

Redirecting to non-www using the Web.config

You can always use IIS to explicity set up a redirect, but I find that these types of configurations are best done in the Web.config, since they are (1) more portable, (2) have the ability to be stored in source control, and (3) can be included in Web.config transformations if you want to get all fancy!

Here’s what you need to add to your Web.config:

        <rule name="Redirect to non-www" stopProcessing="true">
            <match url="(.*)" negate="false"></match>
            <action type="Redirect" url="{R:1}"></action>
                <add input="{HTTP_HOST}" pattern="^domain\.com$" negate="true"></add>


Note: You’ll need to make sure that for redirecting a site like to, you’ll need to make sure that you’ve configured both of those domains to point to your website. If you never set up the www. site to point to your host, IIS and your Web.config will never be hit to do a redirection.



Collect Lost SEO

And that’s it! These redirects have huge effects on what I call “accidental” SEO. All over the internet you’ll find people in the habit of hand-linking to websites, and we’ve got a bad habit of just assuming www and non-www links are inter-changeable, when they’re not. Setting up these redirects will ensure you get credit for all (or many, many more) of the links to your site that are out there on the web.

Use CSS background:rbga to Darken Background Photos For Improved UX


If you’ve been to any new websites lately, you’ll know that parallax scrolling and large background images are incredibly popular right now. They’re great because they are able to help better tell stories, with big, gorgeous photos on the background and relevant text in the foreground overlaying those images as you scroll. In addition, responsive design means that the text overlaying these photos can move around. One of the challenges in this is that you’re likely to run into an issue where you have the text the same color as the image behind it. There are a couple of ways to deal with this, but let me show you my personal favorite.
There is a relatively newer CSS property that you can apply to a background where you can overlay it with a color and specify the opacity (seethrough-ness). Using this is a great way to darken the background just enough to make white text more readable and pop. Here’s an example of the before and after shot on my blog:
Continue reading…

How Using jQuery’s $.get() Can Cause Subtle Bugs in Single Page Apps

While working with a single page app I inherited the other day, I ran upon a few very subtle bugs where I would save data on the screen and it would update in some places, but look like it wasn’t being updated in others. It was maddening, and it ended up just being the difference between getting information from the server via the $.ajax() function vs the $.get() function, which I’ll explain after the break.  Subtle bugs are the worst, but they’re even harder when you’re using a lower level library like jQuery to build a single-page webapp when there are special-built libraries like Angular.js, Ember, and Knockout designed specifically for this purpose. Even still, sometimes you may want to use jQuery to add some dynamic-ness to your app, so I won’t judge!  If you do, you HAVE to remember this difference: Continue reading…

3 Ways to Web Test that will Change Your Life

As a web developer, it’s important to make sure our web apps and sites have a great experience for users no matter what browser they’re using. One of the ways we can do that is adhering to web standards. When we don’t write standards-compliant code and markup, we’re basically betting that all browsers will just magically guess what we meant and somehow do the right thing.  Once you’ve run your markup through, and made sure to use feature detection instead of browser sniffing, which doesn’t work anymore, the next step is to test on actual browsers.  If you only have a Mac, though, how do you even go about testing IE in the first place?  For starters, that sounds expensive…getting a Windows license, maybe hardware, not to mention different OS licenses for IE11, IE9, etc.  What if I told you that you can test IE for FREE (any OS/version combination that’s relevant today)?  Here’s 2 different ways how: Continue reading…