Skip to content

Coding Practice

How to Create a Catch All Requests Route in ASP.NET MVC 5

I will soon move a web application to a different domain. Without any extra work this change will break the existing URLs. To prevent this from happening, I try a new approach with a small replacement application that accepts every request to the old domain name, logs its referring site and redirects the user after a few seconds to the new application.

Web.Config Transformation Is Still a Thing

Visual Studio has an old but still helpful way to change your web.config file based on the environment or build mode. This allows you to replace connection strings or the configuration for web services without the need to fiddle with XML. You still need to write XML Transformation code, but that is a lot simpler than modifying everything on your own.

Creating links between web pages is the foundation of the world wide web. You can do that with the HTML a tag and the href attribute. The default behaviour of a web browser is to bring you on the top of that linked page. While this works for most cases, sometimes you want to link to a more specific part. There is a simple solution to improve the user experience if you can modify the linked page.

What to Do If GitHub Desktop Cannot Find Your Repositories

I use GitHub Desktop since it was called GitHub for Windows. In those 8 years I never had problems with this Git client – at least until a few days ago where nothing worked at all.

It started as I tried to push to one of my Git repositories at GitHub. Instead of synchronising my changes, GitHub Desktop asked if I want to create a remote repository. I expected that my login token was no longer valid. Therefore, I signed out and logged in to get a new one. That did not change anything. I put this problem aside and tried to clone another one of my repositories. However, the list of my GitHub repositories was empty.

Lightweight Web Development on Your Local Machine

In the good old days doing web development was a lot simpler. We just open a HTML file from the local filesystem in our browser and the referenced CSS and JavaScript files where loaded as well. We could focus on getting our web site right without the need for a local server or any other infrastructure.

NDC Oslo 2020 - the Online Edition

We all wanted to be in Norway for NDC Oslo 2020, but Covid-19 made that impossible. As with most other conferences in 2020, there was no way to make this an in-person event. The NDC crew and Dylan Beattie did their best to create the typical NDC feeling at an online-only conference. I was surprised how well it worked and how few problems occurred for an event with around 1000 attendees.