How to switch to C# 11

Feature is not available in C# 10.0. Please use language version 11.0 or later. There are two ways to approach this: Language version is greyed out and cannot be modified The Language version cannot be changed from the Properties window of the project. The version is linked to the target .NET framework version of your…

C# – Best way to Throw Exception If Null

.NET 6 introduced a few new helper methods to deal with throwing exceptions, and one of them is ThrowIfNull. The usage is simple: The method will throw a ArgumentNullException when myParam is null. It will do nothing otherwise. ThrowIfNull can take in two parameters: Note: paramName uses CallerArgumentExpressionAttribute to retrieve the name of your parameter…

| |

How to publicly expose your local SignalR service for consumption by mobile clients using ngrok

When dealing with mobile clients, it’s not always easy to get them on the same network as your development machine and even when you do, localhost will have a different meaning so you need to use IPs and change bindings and disable SSL or trust self-signed certificates, in short it’s a pain. Say hello to…

|

Periodically update your live tiles using ScheduledTaskAgent

I’ve covered in a previous post how to create wide tiles for your Windows Phone 7 application. Now it’s time to bring them to life. The easiest way to do so is by using a ScheduledTaskAgent. To create one go ahead and add a new project to your solution and from the project templates list…