ASP.NET Core

Blog posts about ASP.NET Core

dotnetcore bootstrap

ASP.NET Core 2 with Bootstrap 4 Bundler Minifier Issue: Expected semicolon or closing curly-brace found '-'

453 views   1 comments last modified about 4 months ago

Background When upgrading Bootstrap to v4.0.0 release, the bundler and minifier doesn’t work properly due to CSS variable is commonly used: :root{--blue:#007bff; About 26 errors will show up in the Error List with the following message: ...

View detail
dotnet core asp.net core

Retrieve Http client request metadata like IP address and languages in asp.net core

543 views   0 comments last modified about 8 months ago

IP Address In ASP.NET Core, Request.UserHostAddress has been removed though that attribute exists in the traditional ASP.NET applications. We can use HttpContext.Connection to retrieve the remove client IP address: var ipAddress = HttpContext.Connecti...

View detail
asp.net core identity core 2

Retrieve Identity username, email and other information in ASP.NET Core

404 views   0 comments last modified about 8 months ago

The identity system in ASP.NET has evolved over time. If you are using ASP.NET Core, you probably found User property is an instance of ClaimsPrincipal in Controller or Razor views. Thus to retrieve the information, you need to utilize the claims.

View detail
.net core azure

Retrieve Azure AppSettings and Connection String Settings in ASP.NET Core Apps

790 views   0 comments last modified about 8 months ago

In ASP.NET Core, we can easily use user secrets to manage our password or credentials. This post will summarize the approaches we can use after the websites are deployed into Azure.

View detail
asp.net core 2

Server.MapPath Equivalent in ASP.NET Core 2

2692 views   0 comments last modified about 8 months ago

In traditional asp.net applications, Server.MapPath is commonly used to generate absolute path in the web server. However, this has been removed from ASP.NET Core. So what is the equivalent way of doing it?

View detail

OpenIddict Refresh Token Flow issue ASP.NET Core 2.0

851 views   0 comments last modified about 9 months ago

Context When I followed OpenIDDict refresh flow sample, I constantly got the issue “The refresh token is no longer valid”, which is returned by the following code in my authorization web api controller: result.Content = new OpenIdConnectResponse  &...

View detail