Category: code

Tips for Sql query performance

The following are a list of good practices I follow when querying large sets of data. SELECT * Avoid selecting all columns from a table. Queries should explicitly list each column it requires Changing column definitions on the underlying tables can have an adverse effect on dependencies such as views, name clashes etc Avoid reading and returning unnecessary data Can… Read more →

How to download a nupkg file

You can download nupkg files by navigating directly to the url using the syntax:<xyw> where <xyz> is the name of the package you are seeking e.g. You can also request earlier versions of the package by specifying the version in the url e.g. Read more →

TeamCity: Agent has unregistered (will upgrade)

I have been getting the TeamCity error Agent has unregistered (will upgrade) with an upgraded installation for sometime and today on a new installation. Both installations are configured to run as a dedicated Windows user account. The problem can be resolved by adding the Windows user to the Administrators group, restart the Build Agent service and wait for the upgrade… Read more →

Url Redirect for moved blog

namespace Director { public class HttpModule : IHttpModule { public void Init(HttpApplication context) { context.BeginRequest += new EventHandler(this.context_BeginRequest); } private void context_BeginRequest(object sender, EventArgs e) { HttpApplication application = (HttpApplication)sender; HttpContext context = application.Context; if (context.Request.FilePath.TrimEnd(‘/’).Length > 0 && !File.Exists(context.Request.PhysicalPath)) { context.Response.Redirect( $”{context.Request.FilePath}”, true); } } public void Dispose() { } } } <system.webServer> <modules runAllManagedModulesForAllRequests=”true”> <add name=”HttpModule” type=”Director.HttpModule” />… Read more →