Archives
-
Inline Images with ASP.NET Core
The most common way to show an image in an HTML page is to use the <img> tag to load an external resource. Another option is to use a URL that is a Base64 encoded version of the image. There are some aspects worth considering:
-
Interfaces and Inversion of Control
The way I see it, there are three reasons for using an Inversion of Control (IoC) / Dependency Injection (DI) container:
-
ASP.NET Core Pitfalls – Dependency Injection Lifetime Validation
As you can imagine, it doesn’t make much sense to have a service that is registered as singleton to depend on another service that is registered as scoped, because the singleton instantiation will only happen once. Take this example:
-
ASP.NET Core Pitfalls Index
Last update on March 25th. Reversed order, latest ones first.
-
ASP.NET Core Pitfalls – Returning a Custom Service Provider from ConfigureServices
In pre-3.1 versions of ASP.NET Core, you could return your own service provider (AutoFac, Ninject, etc) by returning some IServiceProvider-implementing class from the ConfigureServices method. This is no longer supporting, and having code like this results in an NotSupportedException being thrown at startup:
-
ASP.NET Core Pitfalls - Localization with Shared Resources
When localizing a web application using resources, there are two common ways:
-
ASP.NET Core Pitfalls – Areas
There are a few problems with using areas: