Thursday, August 13, 2020

Wednesday, July 22, 2020

stdoutLogFiles

Change stdoutLogFiles to get the desired result at Angular 5. Valerio De Sanctis mentions it on the 4th to last page of ASP.NET Core 2 and Angular 5 and it was a fine booklet.

Friday, July 10, 2020

Adobe ImageReady

This used to be given away free with Photoshop some years back, like twenty. It was a bitmap editor.

Wednesday, May 13, 2020

.GetService in Framework and Core

This is in the .NET Framework stuff. This cannot move. There is no HttpConfiguration in .NET Core.

private static void InitAuthorizationCache(HttpConfiguration config)
{
   var cacher = (ICacher)config.DependencyResolver.GetService(typeof(ICacher));
   var logger = (ILogger)config.DependencyResolver.GetService(typeof(ILogger));
   var authorizationCache = new AuthorizationCache(cacher, logger);
   authorizationCache.LoadCache();
}

 
 

Alright, in Startup.cs, of a .NET Core 3.1 application, we can jam what is above, in here:

public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
   var cacher = (ICacher)app.ApplicationServices.GetService(typeof(ICacher));
   var logger = (ILogger)app.ApplicationServices.GetService(typeof(ILogger));
   var authorizationCache = new AuthorizationCache(cacher, logger);
   authorizationCache.LoadCache();

 
 

                                    

I will not show all of the method immediately above because it eventually has app.UseEndpoints in it, etc. Run the ILogger using using Serilog.

Tuesday, May 12, 2020

app.UseEndpoints

You probably need app.UseEndpoints even if you don't need everything inside. You could maybe leave it blank, and especially if each Controller has...

[ApiController]
[Route("api/[controller]")]

 
 

    

...decorating it. In that scenario have:

app.UseEndpoints(endpoints =>
{
});