Using IHttpClientFactory in ASP.NET Core

In today’s post, we will see how to create named HTTPClient requests using HTTPClientFactory in .NET Core or ASP.NET Core. Create a Named HTTPClient Create an ASP.NET Core Project Let’s look at step by step to understand and create named HTTPClient approach where we shall be creating HTTPClient request object using HTTPClientFactory. Interface IHTTPClientFactory  can be injected in Controller […]

Read more
Caching Static Resources Forever with ASP.NET Core

Caching static resources like stylesheet, JavaScript, or image files allows improving the performance of your website. On the client-side, a static file will always be loaded from the cache which reduces the number of requests to the server and so, the time to get the page and its resources. On the server-side, as they are […]

Read more
How to Run MySQL Connector in ASP.NET Core

This tutorial shows how to use MySQL database with MySQL Connector in Asp.net Core. Before we start it, please make sure you have installed MySQL 5.7, .NET Core, Visual Studio, and also Sakila sample database. Let’s Get Started 1. The first step is to create ASP.NET Core Web Application and you can name it. For […]

Read more
How to Redirect WWW and non-HTTPS in ASP.NET Core

In this article, we will give short tutorial about how to redirect your www and non-HTTPS ASP.NET Core website. This is to make sure that your site will be ranked higher, since Google does not like different URLs, for example ones with and without “www.” to show the same content. Redirect Request in ASP.NET Core […]

Read more
Using Mailkit to Send Email ASP.NET Core 3.1

This post is an example how to send email in Asp.net Core 3.1 using Mailkit. I assume that you have downloaded it and install it on your server. How to Send HTML Email in ASP.NET Core This code sends a simple HTML email using the Ethereal free SMTP testing service, you can create a free test account […]

Read more
Use Serilog ASP.NET Core to SQL Server Database

Logging is an essential feature for any application, as it is necessary for detecting, investigating, and debugging issues. Serilog is a third-party, open source library that allows .NET developers to log structured data to the console, to files, and to several other kinds of data stores.  This article discusses how we can use Serilog to log structured […]

Read more
How to Customize ASP.NET Core Default UI

ASP.NET Core Identity includes a default UI as a Razor library that enables you to quickly add users to an application, without having to build all the UI yourself. The downside is that if you want to customise any of the pages associated with the default UI, then you end up taking ownership of all […]

Read more
How to Run .NET Core Generic as Windows Service

Net Core 2.2 provides Web Host for hosting web applications and Generic Host that is suitable for hosting a wider array of host apps. In the .Net Core 3 Generic Host will replace Web Host.  Generic Host will be suitable for hosting any kind of app including web applications. I looked at many examples but found that none showed […]

Read more
Top 13 ASP.NET Core Features that You MUST Try

ASP.NET is one of the most successful web application development frameworks by Microsoft. With every update, new and extended features are added that help developers deploy highly scalable and high-performance web applications. When coupled with application monitoring and other performance tools, such as a profiler, ASP.NET becomes a powerful solution for building incredible apps. Within the framework itself, there […]

Read more
How to Host ASP.NET Core 2.0 Application in Docker

In today’s article, we will create an ASP.NET Core 2.0 MVC web application with Docker support and then, we will deploy our application in a Docker container (Windows 10). Why do we need this? The main purpose of Docker is to deploy applications to the production environment or other environments as required by Ops. However, […]

Read more