skip to content
Relatively General .NET

Implementing ASP.NET Core Automatic Span (Activity) Linking for Internal Redirects with Middleware on .NET 9

by Steve Gordon

posted on: October 08, 2024

Today, I’ll continue a current theme for my content based on my experiences implementing OpenTelemetry instrumentation in practice for .NET applications. In this post, I want to focus on a minor enhancement I recently added to a project that enables span links between request traces on ASP.NET Core during internal redirects. NOTE: This code relies […]

Replacing Exceptions-as-flow-control with the result pattern

by Andrew Lock

posted on: October 08, 2024

Working with the result pattern - Part 1

Allow incoming ping requests on Windows machines

by Gérald Barré

posted on: October 07, 2024

Sometimes you need to allow ping requests for monitoring purposes. By default, it could be disabled on Windows machines. To enable it, you can use the following command:Shellcopynetsh advfirewall firewall add rule name="Allow Ping" protocol=icmpv4 dir=in action=allowDo you have a question or a sugg

An Efficient Dictionary for IPAddress Tracking using .NET 9 with AlternateLookup and IAlternateEqualityComparer

by Steve Gordon

posted on: October 02, 2024

In this post, I will introduce and demonstrate enhancements to collections in .NET 9 and C# 13 for low-allocation code paths. Specifically, I will demonstrate using a custom IAlternateEqualityComparer and the AlternateLookup on a Dictionary used for efficiently tracking IP address information, keyed on the bytes of IP addresses. My use case, the basis for […]

Major updates to NetEscapades.​AspNetCore.​SecurityHeaders

by Andrew Lock

posted on: October 01, 2024

In this post I describe the recent major changes to NetEscapades.AspNetCore.SecurityHeaders, a NuGet package for adding security headers to your apps.…

Disabling HSTS for localhost using a browser extension

by Gérald Barré

posted on: September 30, 2024

Http Strict Transport Security (HSTS) is a security mechanism that instructs the browser to automatically redirect http requests to https before sending a request to the server. When you are developing a web application, you should disable HSTS for localhost. This is because enabling HSTS on localh

Receiving GitHub Webhooks When Using the ASP.NET Core Developer Certificate

by Steve Gordon

posted on: September 24, 2024

SERIES: A Guide to Developing GitHub Apps on .NET For the last couple of weeks, I have been experimenting with creating a GitHub App using .NET. I’ve been pursuing this because I have an idea for an integration that could be interesting, and it also provides a real-world scenario to keep my skills fresh. I […]

New features for RavenDB Cloud

by Oren Eini

posted on: September 23, 2024

The Cloud team at RavenDB has been working quite hard recently. The company at large is gearing up for the upcoming 6.2 release, but I can’t ignore the number of goodies that have dropped for RavenDB Cloud Customers.Large Clusters & ShardingRavenDB Cloud runs your production cluster with 3 nodes by default. Each one of them operates in a separate availability zone for maximum survivability. The new feature allows you to add additional nodes to your cluster. In the RavenDB Cloud Portal, you can see the “Add node” button and its impact:Clicking this button allows you to add additional nodes to your cluster. The nodes will be deployed and attached to your cluster within a minute or two. The new nodes will be deployed in the same region (but not necessarily the same availability zone) where your cluster is already deployed.There are plans in place to add support for deploying nodes in other regions and even in a multi-cloud environment. I would love to hear your feedback on this proposed feature.You can see the new instances in the RavenDB Studio as well:The key reason for adding additional nodes to a cluster is when you have very large datasets and you want to shard the data. Here is what this can look like:In this case, we have sharded the data across 5 nodes, with a replication factor of 2. Feature selectionThere are certain Enterprise features that are only available in the higher-end instances in RavenDB Cloud (typically P30 or higher). We now allow you to selectively enable these features even on lower-tier instances. This feature allows you to easily pick & choose (on an a-la-carte basis) the specific features you want, without having to upgrade to the more expensive tiers. Metrics & monitoringThis feature isn’t actually new, but it absolutely deserves your attention. The RavenDB Cloud Portal has a metrics button that you should get familiar with:Clicking it will provide a wealth of information about your cluster and its behavior. That can be really useful if you want to understand the system’s behavior. Take a peek:Alerts & WarningsIn addition to just looking at the metrics, the RavenDB Cloud backend will give you some indication about things that you should pay attention to. For example, let’s assume that we had a node failure. You’ll typically not notice that since the RavenDB Cluster & client will work to ensure high availability. You’ll be able to see that in the metrics, and the RavenDB Cloud Portal will bring it to your attention:SummaryThe major point we strive for in RavenDB and RavenDB Cloud is the notion that the entire experience will be seamless. From deployment and routine management to ensuring that you don’t have to concern yourself with the minutiae of data management, so you can focus on your application.Being able to develop both the software and its execution environment greatly helps in providing solutions that Just Work. I’m really proud of what we have accomplished and I would love to get your feedback on it.

Interfaces Describe What - Implementations Describe How

by Ardalis

posted on: September 23, 2024

When working with software development, especially in object-oriented or component-based systems, understanding the distinction between…Keep Reading →

Using Mutex<T> to synchronize access to a shared resource

by

posted on: September 23, 2024

When you need to access a shared resource, you can use the lock statement or a synchronization primitive such as a Mutex to synchronize access to the resource. However, it's easy to forget it in complex code. When you need to synchronize access to a single resource, you can use aC#copyvar obj = new