skip to content
Relatively General .NET

Debugging tips and tools

by Gérald Barré

posted on: November 07, 2022

Here are some tips and tools to help you debug your .NET applications. The goal is not to be exhaustive, but to give you some ideas on how to debug your applications. Table Of ContentsRandom tipsIs the code executed?Starting the debugger from the codeDebugging more than one process at a timeObservi

RavenDB Python client API stable release

by Oren Eini

posted on: November 04, 2022

We have just released a new stable release of the RavenDB Python client API. This puts the Python client API for RavenDB on the same level as our other clients, including support for subscriptions, cluster wide transactions, compare exchange, conditional loading, and much more. We also improved the ergonomics of the API and integration with the IDE. Here is an example of writing a non-trivial query using the API, tell us what you think and what you are doing with RavenDB & Python.

Pasting text without formatting

by Gérald Barré

posted on: October 31, 2022

Google Chrome / Microsoft Edge: Ctrl + Shift + VWindows: Win + V, Then click "…" (see more), Then "Paste as text". To use the keyboard, you can press Tab Enter to select the option:Using Windows PowerToys - Paste as Plain Text: Ctrl + Win + VNote: you can change the shortcut in the configurationMic

C# as a System Language recording

by Oren Eini

posted on: October 26, 2022

In just 20 minutes, I try to condense ~15 years of working on a database engine in C# / .NET and show how you can use C# to build system software. I think it ended up being really nice:

Generic types are for arguments, specific types are for return values

by Vladimir Khorikov

posted on: October 25, 2022

Today, we’ll discuss the following guideline: you should use the most generic types possible for arguments and the most specific types possible for return values.

Fighting with nullable reference types in Razor Pages

by Andrew Lock

posted on: October 25, 2022

In this post I discuss C#'s nullable reference types in the context of Razor Pages, why they don't play nicely together and how to improve the experience.…

New rules for Blazor in Meziantou.Analyzer

by Gérald Barré

posted on: October 24, 2022

Static analysis is a great way to improve the quality of your code and detect errors before they happen. Blazor has some dynamic parts, so some errors occur only at runtime. In this post, I describe the recent updates in Meziantou.Analyzer to detect some of these errors at compile-time.Meziantou.An

RavenDB indexing

by Oren Eini

posted on: October 20, 2022

When you search for some text in RavenDB, you’ll use case insensitive search by default. This means that when you run this query: You’ll get users with any capitalization of “Oren”. You can ask RavenDB to do a case sensitive search, like so: In this case, you’ll find only exact matches, including casing.  So far, that isn’t really surprising, right? Under what conditions will you need to do searches like that? Well, it is usually when the data itself is case sensitive. User names on Unix are a good example of that, but you may also have Base64 data (where case matters), product keys, etc. What is interesting is that this is a property of the field, usually. Now, how does RavenDB handles this scenario? One option would be to index the data as is and compare it using a case insensitive comparator. That ends up being quite expensive, usually. It’s cheaper by far to normalize the text and compare it using ordinals. The exact() method tells us how the field is supposed to be treated. This is done at indexing time. If we want to be able to query using both case-sensitive and case-insensitive manner, we need to have two fields. Here is what this looks like: We indexed the name field twice, marking it as case sensitive for the second index field. Here is what actually happens behind the scenes because of this configuration:   The analyzer used determines the terms that are generated per index field. The first index field (Name) is using the default LowerCaseKeywordAnalyzer analyzer, while the second index field (ExactName) is using the default exact KeywordAnalyzer analyzer.

Introducing Spectre.Console

by Ardalis

posted on: October 19, 2022

Spectre.Console is a dotnet library for making beautiful, more useful console applications. Here's a quick introduction to getting started…Keep Reading →

Accessing State in System.Text.Json Custom Converters

by Steve Gordon

posted on: October 18, 2022

In this post, I describe several techniques that can provide additional state to custom JsonConverters when using System.Text.Json. While building the new .NET client for Elasticsearch, one of the key objectives I gave myself was to move away from the internal Utf8Json-based serializer used in v7. The obvious choice was to look at redesigning the […]