-
Create Solutions & Class Diagrams with SolutionUtil (slnutil)
New features in SolutionUtil! 1) Create entire solutions (including MAUI with xUnit Tests) and 2) UML class diagrams from .NET Assemblies
-
How to Fix C# Primary Constructor Warning: CS9107 “Parameter is captured into the state of the enclosing type”
In refactoring a C# project, the author encountered the CS9107 warning in Visual Studio 2022 while using Primary Constructors. This warning arises from a shared variable reference between the primary constructor and the base class. The fix involves using the base class variable exclusively to avoid dual references, eliminating the warning.
-
How to Fix Azure App Service Remote Debugging in Visual Studio 2022
I was getting a strange authentication error when trying to remote debug an Azure App Service using Visual Studio 2022. The issue was ultimately due to basic authentication being disabled. Here’s how to fix remote debugging in VS2022 and Azure App Services.
-
How to Add Performance Counters to your .NET Core Application
The post discusses ways to monitor the performance of .NET Core applications for DevOps observability and for performance tuning. We start by explaining how to implement performance metrics in .NET Core applications using System.Diagnostics.Metrics. We wrap up by showing you how to use a tool called dotnet-counters to view the live performance data.
-
.NET Core Solution & Project Utilities (slnutil)
Announcing the Solution & Project Utilities (slnutil)! These are a collection of the handy utilities that I’ve written for working with .NET Core Solutions, Projects, and configuration files. I hope you find them useful.
-
Fixing the dreaded JsonConverter JsonException: “Converter read too much or not enough”
Last week I wrote about creating a JsonConverter to handle some funky data conversion problems I was experiencing using System.Text.Json.JsonSerializer’s Deserialize<T>() method. I had some JSON-formatted data coming back from Azure DevOps and when I was parsing it, there were some data type formats that System.Text.Json.JsonSerializer wasn’t especially happy about. The solution to the problem…
-
Fixing JSON parsing exception “value could not be converted” using a JsonConverter
I’ve been working on a tool lately to parse a bunch of work item data from Azure DevOps. Specifically, I needed to call the Work Item Updates REST service in order to get all the state value changes for a bunch of work items. Everything was fine until I needed to convert the JSON result…
-
Azure DevOps API Continuation Tokens / Graph API not returning all users
I was doing some work last week with Azure DevOps user and security management Graph APIs. The Graph APIs let you manage users, and groups, and group memberships and I needed to make some changes for a couple thousand user accounts. It was definitely worth automating. When I was working with the API call that…
-
Angular WebAPI Project using .NET Core gets ‘404 Not Found’ or runs on wrong port
My Angular / WebAPI application suddenly stopped working from Visual Studio and VSCode. Turned out that I was missing an environment variable.
-
C#: How to Find All Files Including Hidden Files?
I was writing some code yesterday that needed to enumerate all files in a directory. So I wrote what I’ve been writing since the beginning of time: var files = Directory.GetFiles(“*.*”, new EnumerationOptions { RecurseSubdirectories = true }); At first, it seemed to be working just fine but then I noticed that hidden files were…