Category Archives: Tech

WebClient, HttpWebRequest or HttpClient to perform HTTP requests in .NET?

The most common reasons for performing HTTP requests from code are consuming HTTP APIs that have no wrapper library available, and scraping web content. Without resorting to third-party libraries, there are basically three managed ways to perform an HTTP request … Continue reading

Posted in Tech | Leave a comment

Creating easy to debug Windows Services in .NET

When you want a process to run continuously, even when no user is logged in to a machine and when you want that process to start running as soon as Windows does, you may want to create a Windows Service. … Continue reading

Posted in Tech | Tagged , , , | Leave a comment

Stack Overflow reference questions

In this post I keep a list of questions and answers I frequently link to on Stack Overflow. .NET NullReferenceException What is a NullReferenceException and how do I fix it? HTTP 500 – Internal Server Error on IIS How to … Continue reading

Posted in Tech | Leave a comment

Posting sortable form items to an MVC controller

I wanted to allow the user to edit a list of items while also enabling the user to sort them, and to post that back in a meaningful way without parsing on the server side. This does the trick: public … Continue reading

Posted in Tech | Leave a comment

Controller injection with Unity under ASP.NET MVC 4

A lot of different manuals exist on the web explaining various portions of MVC unit testing, Entity Framework mocking and Inversion of Control (IoC) using Unity as dependency injection container. In this and hopefully future posts I’ll try to sew … Continue reading

Posted in Tech | Tagged , , , , , | 1 Comment

An idea for multilingual webpages: the Content-Languages response header

Much content on the web is provided in multiple languages. Think about corporate websites, Wikipedia and various sites running on popular content management systems. The issue I would like to address is the display and selection of the languages the … Continue reading

Posted in Tech | Leave a comment

Using the WebClient class – with cookies!

Contrary to the somewhat crude HttpWebRequest class, the WebClient allows the developer to easily download and upload data and strings from and to webservers. The rough edges of the HttpWebRequest class make developers jump to the WebClient (or HttpClient, since … Continue reading

Posted in Tech | Tagged , , , , | Leave a comment

Configuring a shared packages directory for NuGet and automatically downloading packages

This entry is also available in Dutch. The ever so popular Visual Studio extension named NuGet enables the developer to easily install packages from within the development environment. NuGet packages contain populair and less known libraries, like log4net, jQuery and … Continue reading

Posted in Tech | Tagged , , , | 2 Comments

Sockets and protocols: exchanging messages. Using bytes.

There’s also a Dutch version of this article available. When two applications wish to communicate over an (inter)network, sockets quickly come into play. Nowadays sockets are delivered by almost every operating system, in the form of an API that enables … Continue reading

Posted in Tech | Tagged , , | 4 Comments

Remove Origin advertisements

Do you love the Sims and FIFA advertisements popping up after logging in to Origin when you’re about to play some Battlefield 3? Or even the Premium ads while you already have bought Premium? I don’t, so inspired by this … Continue reading

Posted in Tech | Tagged , , | 4 Comments