How to Use ASP.NET Identity in a Console Apps

Your apps may implement authentication quite easily with the help of Microsoft’s ASP.NET framework. Hardly little has to be done to create a standard web application. You need to do little more than tick a few boxes to proceed. You may not be aware, though, that ASP.NET user authentication may be added to console applications. […]

Read more
Easy Way to Restart Your ASP.NET Core Apps Progamatically

We developers won’t have access to servers all the time, and without management capabilities, it will be difficut to restart a web application. However, in ASP.NET Core, there is a way for us to programmatically restart our application without requring management capabilities from server admins. IApplicationLifetime There is a IApplicationLifetime interface in ASP.NET Core which can handle […]

Read more
5 Ways to Redirect Request ASP.NET Core

In ASP.NET Core applications it is possible to redirect to a specific URL in several different ways. In this article, we will learn about these techniques and the code required to redirect a request in ASP.NET Core There will always be a need for redirection to another URL based on some conditions like redirecting a […]

Read more
How to Make Your ASP.NET Application Pool Keep Alive

Somehow what you need is to have IIS keep website alive. You need to keep your ASP.NET website and application pool always running. Regardless of application pool, website, IIS web server, or the entire server restarting. Perhaps the main reasons could be that you need to initialize some code at the global asax at application start up. To fire […]

Read more
How to Implement Distributed Cache in ASP.NET Core

A distributed cache is a cache shared by multiple app servers, typically maintained as an external service to the app servers that access it. A distributed cache can improve the performance and scalability of an ASP.NET Core app, especially when the app is hosted by a cloud service or a server farm. This article will […]

Read more
How to Send Email Using Gmail in ASP.NET Core

In previous post, I have explained how to send email using Mailkit in ASP.NET Core. In this post, I will explain about how to send email using Gmail in ASP.NET. The .NET framework has built-in namespace for handling email settings, which is System.Net.Mail namespace. In the following example, I’ll use two classes from the System.Net.Mail namespace: For email settings, […]

Read more
How to Use ILogger in .NET Applications to Trace Logging Output

.NET’s greatest strength is its long history of supporting developers through each industry paradigm shift, but just because there’s a new way of doing things doesn’t mean the established method goes away. It’s also a source of confusion and frustration for many. Developers spend time trying to merge the past with the present while also […]

Read more
How to Solve Refresh Tokens in ASP.NET Core Web Api

One thing that comes to mind when using access tokens to secure a web api is what do you do when the token expires? Do you ask the user for credentials again? That’s not really a good option. This blog post is about using refresh tokens to solve this problem. Specifically in ASP.NET Core Web […]

Read more
The Difference Between Middleware and Filters Power in ASP.NET Core

In ASP.NET core, Middleware and Filters are two concepts which are very useful & powerful but often confuses also on which one to choose. Middleware and Filters serves similar purpose and both can be used to achieve the common tasks like exception handling, localizations, authentications etc… but both has certain difference in a way it […]

Read more
How to Build Web Application Using Blazor

This tutorial introduces the Blazor framework by guiding you in building a simple Web application with C#. What Is Blazor? Blazor has been gaining in popularity, especially after the release of .NET Core 3.0, which enriched it with many interesting features. Subsequent versions of .NET consolidated its foundations, and the interest around it is growing so […]

Read more