Tag Archives: .NET Core

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

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

.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

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

.NET Core MVC Web API – control DateTime format in JSON output using JsonSerializerOptions

When creating API’s with .NET Core MVC, you can control the JSON output by adding JsonOptions to the controllers: This will ensure that when requesting application/json from a GET method, the format returned is JSON. You can then add Converters … Continue reading

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

Serilog – Add thread ID to the log file

Serilog is more or less the default file logger when developing .NET Core applications. The simple logger can easily be modified to – for example – add the thread ID. FIRST THINGS FIRST: THE SERILOG NUGET PACKAGES You need these … Continue reading

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