Category Archives: General .NET

Issues related to general .NET and C# development

C# Azure Table Storage QueryAsync, Paging and Filtering

Azure Table Storage is a NoSQL key-value store that can store massive amounts of data in a semi-structured way. Data is stored using a PartitionKey/RowKey keyset and a list of values. So far so good, but how do we query … Continue reading

Posted in .net, .NET Core, c#, General .NET, Microsoft Azure | Tagged , , , , , , , | Leave a comment

Serialization and deserialization of ‘System.IntPtr’ instances are not supported. Path: $.TargetSite.MethodHandle.Value

I added exception handling to my .net core 6 API, and any of my error messages just throws an error 500. The complete exception is as follows: System.NotSupportedException: Serialization and deserialization of ‘System.IntPtr’ instances are not supported. Path: $.TargetSite.MethodHandle.Value. —> … Continue reading

Advertisement

Posted in .net, .NET Core, c#, General .NET | Tagged , , , , , | 2 Comments

Build .net core 6 projects with Azure Devops using yml files

DevOps is a complicated discipline, so when we as developers have to set up a build pipeline in Azure Devops we are sometimes in deep water. Thats why I made this yml template that I can copy from whenever I … Continue reading

Posted in .net, .NET Core, c#, General .NET, Microsoft Azure | Tagged , , , , , , , , , | Leave a comment

Sitecore Create Fully Qualified Url

A classic issue in Sitecore: Some code running in one Site Context is creating a link to a page in another context, and the link turns out to be complete garbage. For example, this code is running in the modules_shell … Continue reading

Posted in .net, c#, General .NET, Sitecore, Sitecore 6, Sitecore 7, Sitecore 8, Sitecore 9 | Tagged , , , , , | Leave a comment

C# SQL Connection Using Azure Managed Identity

Azure Managed Identity is Microsoft’s solution to manage credentials for you, eliminating the need to store usernames, passwords, certificates and other secrets in your config files. Basically, with Managed Identity you establish a trust between a server and a resource. … Continue reading

Posted in .net, .NET Core, c#, General .NET, Microsoft Azure | Tagged , , , | Leave a comment

C# Convert WebP to JPEG in .NET

WebP is a new compressed image format developed by Google. If you want to convert WebP to any other format, you seem to be mostly out of luck if you are using C#. There is, however, some tools out there. … Continue reading

Posted in .net, .NET Core, c#, General .NET, Microsoft Azure | Tagged , , , , | 1 Comment

C# Ignoring Namespaces in XML when Deserializing

Namespaces in XML are hard to understand, I’ll admit that. But even I have learned that namespaces in XML documents matter. These elements are not the same: These 2 set of elements need to be mapped differently when deserialized in … Continue reading

Posted in .net, .NET Core, c#, General .NET | Tagged , , , | Leave a comment

C# List Batch – Breaking an IEnumerable into batches with .NET

There are several ways of batching lists and enumerables with C#. Here are 3 ways: METHOD 1: USING MoreLINQ MoreLINQ is an extension package for LINQ that implements yet another set of useful LINQ expressions like Shuffle, Pad, and Batch. … Continue reading

Posted in .net, .NET Core, c#, General .NET | Tagged , , , , , , | Leave a comment

C# Thread Safe File Writer and Reader

Previously I wrote the article Write to file from multiple threads async with C# and .NET Core, which explains how to use a ConcurrentQueue to append lines to a text file. And the ConcurrentQueue is great for the fire-and-forget scenarios of … Continue reading

Posted in .net, .NET Core, c#, General .NET | Tagged , , , , , | 1 Comment

C# Log to Application Insights and File from your .NET 6 Application

So why would you ever log to Application Insights AND File log at the same time? Well, if you are hosting your own applications on your own machine, it can be great to have a file version of what’s happened. … Continue reading

Posted in .net, .NET Core, c#, General .NET, Microsoft Azure | Tagged , , , | 4 Comments