Posts

Showing posts from December, 2024

2024 in Retrospective

This year was very important to me, professionally. I changed job , wrote 18 + 12 posts (in the old and the new blog ) - which, accidentally, means I got a new blog after 15 years with the old one -, went to some cool Microsoft events, and, finally, was awarded as Microsoft MVP once again ! Some things didn't work out exactly as I was expecting them to, but, in general, it was a very positive year. More news coming soon! I'd like to wish you all an excellent 2025!

.NET Cancellation Tokens

Introduction Cancellation tokens in .NET were introduced as part of the  .NET 4 Cancellation Framework . Essentially, it is a standard, cooperative, way to request for the cancellation of the execution of an operation. By cooperative it means that the code that uses it must abide to some rules, as opposed to the cancellation just stopping (killing) the execution. One example of cancellation is, on a web app, when the client closes the connection while the server is performing some long operation. In cases such as this, we may want to abort the operation, as we are not sending the results anywhere (or not, as we shall see). Because of this, ASP.NET Core allows us to add a parameter of type  CancellationToken  to our asynchronous actions, it is automatically associated with the client and is therefore signalled when the client connection is closed. A  CancellationToken  is, essentially, behind the scenes, a ManualResetEvent . Throughout this article I will either ...

What's New in .NET 9 and C# 13

Introduction .NET 9 and C# 13 have been released some days ago , so it's time for my own resume of the new features. There are tons of improvements, quite a few related to performance, so, beware, if you want the whole thing, you should read the official documentation , these are just my personal choices! Semi-Auto Properties C# 13 introduced a new (experimental as of now, you need to turn on the preview language features for the project) keyword called field , which can be used, in auto-properties , to access the auto-generated field.  To set the language version to preview , add this to your .csproj file: <PropertyGroup> <OutputType>Exe</OutputType> <TargetFramework>net9.0</TargetFramework> <ImplicitUsings>enable</ImplicitUsings> <Nullable>enable</Nullable> <LangVersion>preview</LangVersion> </PropertyGroup> And to make it work: public DateTime Date { get { return field; } ...

MVP Again

Yesterday, December 1st, I was extremely excited to find out that I had been nominated as Microsoft Most Valuable Professional (MVP)  once again! For those of you who are not familiar with this, it is an award granted by Microsoft to some individuals who somehow are relevant to the development community. You can read more about the MVP programme  here . I had previously been an MVP from 2015 until mid 2019, but then I wasn't renewed. This time, my friend and Visual Studio extensions legend Erik Ejlskov Jensen  nominated me, and I was accepted! It is an honour and a privilege to be again part of this exclusive programme, amongst such brilliant people! Besides  Erik , I also need to thank Cristina Gonzalez Herrero , my friend and MVP Community Program Manager for Southern Europe, for reviewing my nomination, and accepting it. Muchas gracias, Cristina! ;-) Please let me know if you want to learn more or discuss this or any other subject. See you around!