How To

How to fix 'CEF can only be initialized once per process'
By Tan Lee Published on Jul 10, 2024 1.87K

The error message "CEF can only be initialized once per process" typically occurs when trying to initialize the Chromium Embedded Framework (CEF) more than once in the same process.

How to get process handle from process name in C#
By Tan Lee Published on Nov 10, 2024 1.94K

To get the process handle from a process name in C#, you need to use the System.Diagnostics namespace, specifically the Process class.

Two-Factor Authentication with Google Authenticator in ASP.NET Core
By Tan Lee Published on Feb 11, 2025 651

In this article, we’ll walk through the steps to implement two-factor authentication (2FA) in your ASP.NET Core web application using Time-Based One-Time Password (TOTP) apps like Google Authenticator and Authy.

Implementing Passkeys to ASP.NET Core Application
By Tan Lee Published on Feb 11, 2025 966

To implement Passkeys in an ASP.NET Core application, you'll need to follow a series of steps to integrate FIDO2 authentication into your application.

How to Implement Passkey Authentication in ASP.NET Core
By Tan Lee Published on Feb 11, 2025 913

In today’s digital world, securing user data while providing a seamless authentication experience is crucial. One of the most promising ways to achieve this is through Passkey authentication.

Implementing Google Authentication in the Blazor WebAssembly App
By Tan Lee Published on Feb 11, 2025 596

Easily integrate Google authentication into your Blazor WebAssembly app to enhance security. The process involves generating Google credentials, installing the Google authentication library, and configuring your app for smooth authentication.

How to sort by multiple fields in Linq
By Tan Lee Published on Feb 10, 2025 314

In LINQ (Language Integrated Query), you can sort by multiple fields using the OrderBy and ThenBy methods.

How to Select distinct objects based on a property in Linq
By Tan Lee Published on Feb 10, 2025 246

There are multiple ways to select distinct objects based on a property in LINQ.

Using yield return to minimize memory usage in C#
By Tan Lee Published on Feb 10, 2025 392

Imagine you are tasked with processing a large dataset, such as reading through a massive log file to identify specific errors and return relevant context objects for further analysis.

How to Add a custom InputFormatter in ASP.NET Core
By Tan Lee Published on Feb 10, 2025 575

How to implement a custom InputFormatter in ASP.NET Core that handles a non-standard content type, such as application/xml, to deserialize the request body into a MyModel object:

How to return a 500 response in ASP.NET Core
By Tan Lee Published on Feb 10, 2025 631

In ASP.NET Core, returning a 500 Internal Server Error response is straightforward. You can use the Problem() helper method, which is a part of the ControllerBase class, to return a standardized error response.

How to use data annotations in C#
By Tan Lee Published on Jan 06, 2025 807

Data annotations are attributes from the `System.ComponentModel.DataAnnotations` namespace that can be applied to classes or class members.