Category Archives: .net

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

C# .net Swagger API Versioning – Show versions in your Swagger page

So, Swagger does in fact support versioning in the interface. You just need to do it right, and remember to apply all the attributes and methods. First of all, versioning an API is a standard thing, and will help your … Continue reading

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

.NET API CORS: Response to preflight request doesn’t pass access control check: No ‘Access-Control-Allow-Origin’ header.NET API

What to do if you get the following error in the browser when calling a CORS protected .NET Core API endpoint: Response to preflight request doesn’t pass access control check: No ‘Access-Control-Allow-Origin’ header is present on the requested resource. Origin … Continue reading

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

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