2

ASP.NET Core 8: Better contextual debugging experience

 11 months ago
source link: https://anthonygiretti.com/2023/06/18/asp-net-core-8-better-contextual-debugging-experience/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

ASP.NET Core 8: Better contextual debugging experience

2023-06-18 by anthonygiretti

Introduction

ASP.NET Core 8 brings a great improvement on contextual informations. The latter improves debugging experience by implementing new customized attributes on several informations like HttpContext, HttpResponse, Features and more… In this post I will show you the difference ASP.NET Core 8 and previous versions.

Improved debugging experience by example

Before ASP.NET Core 8, the debugging experience wasn’t very informative at first glance, as you can see by debugging the context of an HTTP request through IHttpContextAccessor. The following example is based on authentication with a JWT:

beforeaspnetcore8improveddebugauth-1024x440.png

As you can see many information like :

  • Connection
  • Features
  • Items
  • Request
  • Response
  • Session
  • WebSocket

are not really helpful. If you take the same HTTP Request with ASP.NET Core 8, it gives the following:

aspnetcore8improveddebugauth-1024x589.png

Since ASP.NET Core 8 I still in preview, there are probably some bugs, I’m waiting for an answer why Principal Identity Name debug property is Null when I’m authenticated:

aspnetcore8improveddebugauthdetail-1024x560.png

Once I’ll get an answer I will update this post and give more information on this.

Like this:


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK