Friday, May 11, 2018

Deleting the dist folder and the default Error action.

Page 50 of "ASP.NET Core 2 and Angular 5" by Valerio De Sanctis touches on these two things. If you destroy the dist folder in the wwwroot folder in a .NET Core Angular project and then rerun the app, the folder will get recreated taking into account changes made to package.json, webpack.config.js, and webpack.config.vendor.js files as if you had run this command, but you don't have to run the command. Page 50 also points out that in the HomeController one will see:

public IActionResult Error()
   ViewData["RequestId"] = Activity.Current?.Id ?? HttpContext.TraceIdentifier;
   return View();


Here Activity.Current?.Id is a goofy id for the .NET context's immediate scope and HttpContext.TraceIdentifier is going to be a comparable id for the HTTP act itself should the first id be unavailable. The setting gets stuffed in ViewData FTW!

No comments:

Post a Comment