Visual Studio 2017 tips

  • We can specify a ,nq in debugger display attribute to prevent VS to visualize quotes surrounding string value:

[DebuggerDisplay(“Name: {FullName,nq}”)]

  • We can use DebuggerDisplayAttribute as assembly attribute to decorates types from other assemblies:
[assembly: DebuggerDisplay("Host: {HostName}", Target = typeof(IPHostEntry))]

Great tips from 7 Hidden Gems in Visual Studio 2017 | The Visual Studio Blog



X.509 certificates in .NET

Great summary: Eight tips for working with X.509 certificates in .NET – Paul Stovell.

Also found:

How to implement a formatter in Asp.Net Core

How to handle raw data in request body either manually or by registering a custom InputFormatter: Accepting Raw Request Body Content in ASP.NET Core API Controllers – Rick Strahl’s Web Log.

One big issue with automatic conversion between content body and an action parameter is how to handle too big content (in case of DOS for example). Reading any content body into a byte array could be very dangerous for server health in case of a large body.  This also prevents an always preferable handling using the streamed way.

.Net Core 2.0: first step to GC customization

.Net Core 2.0 have a new interesting feature: the ability to customize GC. It’s not already in standard version, we must compiled a custom CoreCLR version but it’s in source code now!

This post describes how to build a GC version doing nothing (ie with no garbage collection at all). This can be used in very specific apps and as the first step to a custom GC.

Yet another proof that .Net Core is moving in the right  direction.

Zero Garbage Collector for .NET Core – TooSlowException

“How much memory is your process using?”

This post does a great job sumarizing the different notions behind memory management in Windows. Clear and consise explanations details virtual/physical, commited/reserved and how section sharing can complexify computation of “How much memory is your process using?”.

A link that is worth preserving at least for the definition of each term: Windows Process Memory Usage Demystified | All Your Base Are Belong To Us

Minidumper: cli to generate minidump

This cli tool is able to generate minidump of living app in three mode: full, minimal and heap. heap is really interesting because:

“dumps generated by the heap mode can be 5x or 10x smaller than full memory dumps, but will still allow complete investigation of many .NET issues by tools like Visual Studio and WinDbg (SOS)”

goldshtn/minidumper: Write minidumps of .NET processes with full memory, only CLR heaps, or no memory at all

Moreover, mini dump generation is located into an external library: DumpWriter. This library can be integrated into any program to add mini dump generation capability.

Generating a minidump is technically easy. You call MiniDumpWriteDump with a MINIDUMP_TYPE parameter to choose wich memory ranges to gather  or use a CallbackParam to manually filter memory ranges. But choosing the right one is a complicated process. Other posts are related on how memory ranges are choosen to be saved in heap mode :