Blazor and .NET Core hosting – the future’s bright

In a past life, I was a web developer. In this post, I’d like to take an outsiders perspective on a couple of developments that I think will be hugely disruptive in the coming years. The first of these is .NET Core making it possible to run .NET websites on cheap hosting. The second is Blazor, which promises to let us use .NET for front-end web scripting – replacing Javascript. This post is a bit more soapbox-y than usual, so bear with me!

Continue reading

Testing without compromise using InternalsVisibleTo

Have you ever wanted to test the behaviour of a method, without making it part of your public API? Have you ever been forced to choose between compromising on the encapsulation of your business logic, and ensuring that it behaves as expected? Allow me to introduce the InternalsVisibleTo attribute! In this post, we’ll look at what this lets you do, but we’ll also touch briefly on the debate surrounding its use.

Continue reading

PiLights part 1 – kit and test code

At work, we have a system that lots of users interact with, but which sometimes needs some “alone time”. From time to time, we email our users and ask them to close the client application, so that it can do what it needs to do. (Needless to say, this software was not written in-house!) Users being what they are – and emails being what they are – this approach leaves something to be desired.

A colleague and I put our heads together and decided that we needed something obvious, intuitive and highly visible. “What if,” we thought, “we could wire up some traffic lights to a Raspberry Pi?” So that’s what we decided to do. In this multi-post blog series, I’ll outline what parts we used, how we wrote the software, and how we made our little old Pi ready for the enterprise environment. In this first episode, I’ll focus on how we got to a working proof-of-concept.

Continue reading

How-to: Set up log4net on a new project

Today I want to talk about adding log4net to a new project. It’s not hugely complicated or high-tech, but there are a few factors that mean I always seem to struggle with one aspect or another. There’s usually an irritating couple of minutes when I’m Googling questions and seeing purple links! This post is a sort of memo to myself then, and perhaps next time this post will be among those Google results!

Continue reading