Building .NET projects using the Microsoft.Build.Traversal SDK

  • Gérald Barré
Your continuous integration script often looks like dotnet build mysolution.sln and dotnet test mysolution.sln. In my case, I have a solution that contains multiple class libraries and a few WPF projects. I want to create NuGet packages and also test projects on Windows, Linux, and Mac. However, you cannot build WPF projects on Linux or Mac. This means dotnet build fail on these platforms. One way to deal… [read more]

Tracking Cloudflare Worker requests using Application Insights

  • Gérald Barré
This website is hosted on a static website hosting provider and I use Cloudflare CDN to improve the performance. These 2 services allow me to host this website for free even if I got more and more visitors. However, I do not have lots of analytics. For instance, I want to know where the user comes from using the HTTP referer header or if they got a 404. Google Analytics is useful but most users use an… [read more]

Using raw html with isolated CSS in Blazor

  • Gérald Barré
In a project I had to create something similar to a syntax highlighter for a Blazor application. The code takes a string and highlights some parts of it. So, the idea is to create a component which outputs a raw html fragment that uses <span class="style-1">text</span> to colorize some parts of the string. Also, it should use CSS isolation as the style is specific to the component. I've already written… [read more]

Binding decimal numbers using the oninput event in Blazor

  • Gérald Barré
I needed to bind an <input type=number> in a Blazor application. I want to get the value as soon as the user changes the value. There is no problem for integer values. However, this is not as simple for decimal values. First attempt: <input type=number> First, I started with a basic solution. I use an input element and set the oninput event to bind the value as soon as the user change the value. <input… [read more]

Visualizing the code coverage results from Azure Pipelines in Visual Studio

  • Gérald Barré
In a previous posts, I explained how to computing code coverage for a .NET Core project with Azure DevOps and Coverlet. In this post, the code coverage visualization could be done directly in Azure DevOps. As a developer, you want to see these results directly into the IDE. Download the code coverage file from the build artifacts Open the file in Visual Studio In the "Code Coverage Results" tool window,… [read more]