Improvements to HttpLoggingMiddleware in ASP.NET 8

Table of Contents Intro New Config HttpLoggingInterceptor More References Intro .NET 6 began to introduce an http logging middleware. We can use the http logging middleware to record request and response information, but the scalability is not very strong. In the .NET 8 version, some optimizations were made and some New configuration and HttpLoggingInterceptor make […]

.NET Framework 4.8 console application in C# accesses the established database through EF

Table of Contents 1. Create a .NET Framework 4.8 console application 2. Establish a database 1. Establish database Blogging in SSMS 2. Create a new database connection on VS 3. Install the EF package 4. Automatically generate EF models and contexts 1.Blog.cs class model 2. Model of Post.cs class 3.BloggingContext.cs database context 5. Write an […]

Encapsulation and use of JWT in ASP .NET Core

JWT principle: JWT principle Configuring JWT (1) Write the JWT configuration node, and create two configuration items SecKey and ExpireSeconds under the node, which represent the key and expiration time of the JWT respectively (I configured it here in appsettings.json, the expiration time unit is seconds, you can adjust it according to your own situation […]

.NET quickly connects with Jiguang message push

What is push message? Many mobile APPs will push messages to users from time to time. For example, some news APPs will push news that the user may be interested in, or if the APP is updated, they will push messages to the user whether to choose to update, etc. This is the so-called ” […]

Develop a modern .NetCore console program, including dependency injection/configuration/logging and other elements

1Foreword There are a lot of scenarios where gadgets need to be developed recently. Last time I developed a hive export tool using the go language. The experience was pretty good, but I really don’t like the syntax of the go language. This time I will try to use C# to develop gadgets. The function […]

Dynamic compilation technology based on .NET6 in C#

A few days ago, I had to solve a dynamic calculation problem and tried different methods. The problem is that given a string containing calculations, the calculation results are obtained while the program is running. At that time, dynamic compilation was considered and I checked some information on the Internet to complete this function. However, […]

.net core webapi implements localization

Nowadays, projects often require support for localized configuration. There are many ways to achieve localized configuration. For example, Microsoft’s official website provides localized configuration through resx resource files and PO files. However, the scalability of resx resource files is not good, and PO files need to introduce dependency packages. This article mainly introduces another scalable […]

Install Windows SDK 7.1 and .NET4 on Windows 10 64-bit

Purpose: Successfully installed window sdk7.1 and .NET Framework 4 on window10 Requirements: support some older software written in Visual Studio 2010 using Windows SDK 7.1 Steps: 1. Uninstall .NET Framework 4 or above If a version of .NET Framework 4 or above is installed, problems may occur when installing .NET 4 even if sdk7.1 is […]