Logs matter. In Azure, logs generally live in Application Insights, in the Transaction Search section. This post reverse engineers the Azure Application Insights Transactions URL, and details how to construct a link to take you directly there, using both TypeScript and C#.
14 posts tagged with "C#"View All Tags
ESLint your C# in VS Code with Roslyn Analyzers
NSwag generated C# client: Open API property name clashes and decimal types rather than double
NSwag is a great tool for generating client libraries in C# and TypeScript from Open API / Swagger definitions. You can face issues where Open API property names collide due to the nature of the C# language, and when you want to use
decimal for your floating point numeric type over
double. This post demonstrates how to get over both issues.
Directory.Build.props: C# 9 for all your projects
.NET Core can make use of C# 9 by making some changes to your
.csproj files. There is a way to opt all projects in a solution into this behaviour in a single place, through using a
Directory.Build.props file and / or a
Directory.Build.targets file. Here's how to do it.
C# 9 in-process Azure Functions
C# 9 has some amazing features. Azure Functions are have two modes: isolated and in-process. Whilst isolated supports .NET 5 (and hence C# 9), in-process supports .NET Core 3.1 (C# 8). This post shows how we can use C# 9 with in-process Azure Functions running on .NET Core 3.1.
NSwag: TypeScript and CSharp client generation based on an API
Generating clients for APIs is a tremendous way to reduce the amount of work you have to do when you're building a project. Why handwrite that code when it can be auto-generated for you quickly and accurately by a tool like NSwag? To quote the docs:
Nullable reference types; CSharp's very own strictNullChecks
'Tis the season to play with new compiler settings! I'm a very keen TypeScript user and have been merrily using
strictNullChecks since it shipped. I was dimly aware that C# was also getting a similar feature by the name of nullable reference types.
Task.WhenAll / Select is a footgun 👟🔫
This post differs from my typical fayre. Most often I write "here's how to do a thing". This is not that. It's more "don't do this thing I did". And maybe also, "how can we avoid a situation like this happening again in future?". On this topic I very much don't have all the answers - but by putting my thoughts down maybe I'll learn and maybe others will educate me. I would love that!
Snapshot Testing for C#
If you're a user of Jest, you've no doubt heard of and perhaps made use of snapshot testing.
Concatting IEnumerables in C#
I hate LINQ's
Enumerable.Concat when bringing together
IEnumerables. Not the behaviour (I love that!) but rather how code ends up looking when you use it. Consider this:
TFS 2012, .NET 4.5 and C# 6
So, you want to use C# 6 language features and you’re working on an older project that’s still rocking .NET 4.5. Well, with some caveats, you can.
Getting up to speed with Bloomberg's Open API...
A good portion of any devs life is usually spent playing with APIs. If you need to integrate some other system into the system you're working on (and it's rare to come upon a situation where this doesn't happen at some point) then it's API time.
Making PDFs from HTML in C# using WKHTMLtoPDF
I've written a subsequent post which builds on the work of this original post. The new post exposes this functionality via a WCF service and can be found here.
Making PDFs from HTML
I wanted to talk about an approach I've discovered for making PDFs directly from HTML. I realise that in these wild and crazy days of PDF.js and the like that techniques like this must seem very old hat. That said, this technique works and more importantly it solves a problem I was faced with but without forcing the users to move the "newest hottest version of X". Much as many of would love to solve problems this way, alas many corporations move slower than that and in the meantime we still have to deliver - we still have to meet requirements. Rather than just say "I did this" I thought I'd record how I got to this point in the first place. I don't know about you but I find the reasoning behind why different technical decisions get made quite an interesting topic...