Legal Notice
The opinions expressed herein are my own personal opinions and do not represent my employer’s view in anyway.Top Posts
- C# HttpClient POST or PUT Json with content type application/json
- Using C# HttpClient from Sync and Async code
- Read blob file from Microsoft Azure Storage with .NET Core
- C# Get expiry timestamp from JWT token
- ASP.Net Core API - "'s' is an invalid start of a value. Path: $ | LineNumber: 0 | BytePositionInLine: 0."
- C# Using Newtonsoft and dynamic ExpandoObject to convert one Json to another
- Creating dynamic arrays and lists using Dynamic and ExpandoObject in C#
Archive
Meta
Tag Archives: .NET Core
Write to file from multiple threads async with C# and .NET Core
There are several patterns on how to allow multiple threads to write to the same file. the ReaderWriterLock class is invented for this purpose. Another classic is using semaphors and the lock statement to lock a shared resource. This article … Continue reading
Posted in .net, .NET Core, c#, General .NET
Tagged .NET, .NET Core, Asynchronous, ConcurrentQueue, Multithreading
Leave a comment
Sending JSON with .NET Core QueueClient.SendMessageAsync
You need to Base64 encode JSON serialized strings before adding them to a queue Continue reading
Posted in .NET Core, c#, General .NET, Microsoft Azure
Tagged .NET Core, Azure.Storage.Queues, base64string, Queue
Leave a comment
Using full Lucene Query Syntax in Azure Search
The Azure Cognitive Search is the search engine in Microsoft Azure. You can search using a simple queries (default) which is good at doing full text searches, or you can use full syntax which is a Lucene query syntax. The … Continue reading
Posted in .NET Core, Microsoft Azure
Tagged .NET Core, Azure, Azure Cognitive Search, c#, Lucene
1 Comment
.NET Core Worker Services with Application Insights and Serilog
The .NET Core Worker service is yet another tool in the .NET toolbox. They are perfect for background processing like reading from a queue or making health checks. They are cross-platform (of course) and they can run on docker containers, … Continue reading
Posted in .net, .NET Core, c#
Tagged .NET Core, Application Insights, BackgroundService, Serilog
6 Comments
System.DllNotFoundException: Unable to load DLL ‘sni.dll’ or one of its dependencies: The specified module could n ot be found. (0x8007007E)
This message happens when deploying my .NET Core 3.1 application to production (when compiling the code to an .exe file), but not when running the application locally. It turns out, that Dapper is missing a reference to System.Data.SqlClient. Adding the … Continue reading
Command line parameters in .NET Core Console Applications
When implementing .NET Core console applications, you can extract the command line parameters from the void Main(string[] args) method, but it can be a little tedious to do so. To help with the parsing, Microsoft used to maintain the Microsoft.Extensions.CommandLineUtils, … Continue reading
.NET Core Api – Catch exceptions using a middleware
In .NET Core, we are starting to get used to the fact that nothing comes for free, and in the world of ultimate freedom of choice, every feature needs to be implemented by us. This includes error handling. In a … Continue reading
Posted in .NET Core, c#, Microsoft Azure
Tagged .NET Core, Exceptions, IExceptionHandlerFeature, Middleware
5 Comments
ASP.Net Core API – “‘s’ is an invalid start of a value. Path: $ | LineNumber: 0 | BytePositionInLine: 0.”
If you create an ASP.Net Core API Controller, and you wish to create an endpoint that can accept any string, you would expect this to be correct: But this endpoint will only accept strings in quotes, so posting string will … Continue reading
.NET Core API and CORS – allow POST from Javascript using Microsoft.AspNetCore.Cors
After hours of debugging, I finally managed to apply CORS correctly to my .NET Core 3.0 Application. Like so many other before me, I used this article as reference: Enable Cross-Origin Requests (CORS) in ASP.NET Core But I still managed … Continue reading