Gotchas with upgrading to Visual Studio 2017

While upgrading several projects to Visual Studio 2017 I was caught out by three gotchas: I was unable to push changes to remote Git repositories, I had ASP.NET Core applications failing under both Kestrel and IIS Express, and I had ASP.NET Core projects that stopped working under Visual Studio 2015.

This post documents these three issues and provides the solutions I used to work …

Read More

Gotchas with HttpClient's CancelPendingRequests and Timeout in .NET

HttpClient provides a convenient way to make web requests in .NET. But if you want to cancel all pending requests using CancelPendingRequests or use the Timeout functionality, you must be aware of the gotchas.

I recently encountered some strange behaviour where some requests were not cancelled when CancelPendingRequests was called and …

Read More

Gotchas with dynamically adding script tags to HTML

Sometimes you need to dynamically add a script tag to HTML. But there are some gotchas that might get you if you don't know to look out for them.

You might ask, why add scripts dynamically at all? Well, here's two reasons:

  1. When you don't know what to load until runtime.
  2. When you want to load scripts without blocking the page load.

I recently …

Read More

C# 7 Preview: Using tuples to return multiple values

Microsoft is hard at work on C# 7, the next version of C#. In this post, I'll look at tuples, one of the new features proposed for C# 7. So what are tuples, why do we need them, and how do they differ from what we have already.

Tuples are a way to temporarily group multiple values together. Currently, C# handles inputs and outputs asymmetrically. There is syntactic support for passing …

Read More

Hello World!

Hello and welcome to my blog.

I'm Dr Daniel Crabtree, a Web Entrepreneur with a PhD in Artificial Intelligence.

I'll be blogging about programming, technology, and anything else that interests me and hopefully you too.

See you soon.

Read More