Skip to content

{ Author Archives }

MassTransit Distributor (Load Balancing)

MassTransit has a distributor built in now (actually for some time…). I’ll try to explain what it does and how to use it.

What is the distributor? It provides the ability to load balancing across multiple endpoints for a given message.

Topshelf 2.0 Released!

Topshelf 2.0 was released today! You can get it at Topshelf’s github. 2.0.1 was also released today! A bugfix release… Shelving: renamed events no longer cause exceptions Shelving: less likely for a service to start up then re-start again right away There are a couple known issues though… Some log4net log events seem to be [...]

TopShelf 2.0

What is up and coming in Topshelf 2.0?

Data Bound Collections in WPF

One of the joys of working with WPF is that data binding that can exist. At a couple points I’ve wanted to bind a Dictionary as a list. Each item in the list would have a key and only one of those items could exist based upon the the key. Thus I put together two [...]

XAttribute and null values

It turns out that for whatever the reason to the constructor for XAttribute does not accept null values for the value parameter. I think this makes sense even though the XElement constructor will accept null values for the value parameter – mostly because it can still function; a null value for an attribute would be nothing not ‘attributeName=”"‘.

The quick and dirty: there’s an easy solution, use an extension method.
[code lang="csharp"] public static class AddXAttribute
{
public static XElement NewXAttribute(this XElement xa, XName name, Object value)
{
if (xa != null && value != null)
{
xa.Add(new XAttribute(name, value));
}
return xa;
}
}[/code]

VirtualPathProvider for Assemblies

The VirtualPathProvider class provides some options when building websites. One of the most common is to be able to server ASPX/ASCX requests from embedded resources in an assembly. A good place to start is from a CodeProject article that address this issue. First, instead of using hardcode assemblies/paths/etc, a few properties were attached. #region Properties [...]