Posts

Showing posts with the label appsettings

A Better Console Application in .Net Core

Image
  In the old .Net framework 4.X, building a console application was fairly straightforward.  You would simply use the console project template.  This would give you pretty much what you needed. Then came .Net core with its goal of allowing the developer to only use what they needed and to make things modular.  If you use the current Console Project template in Visual Studio 2022, you get this:           // See https://aka.ms/new-console-template for more information           Console.WriteLine("Hello, World!"); This is short and to the point, which is what, n.Net core is all about.  But what if you want to log, use app settings, or leverage dependency injection for your application?  If you want these things, you have to add them yourself.  Every similar to how the other .Net core applications are built. I have dug in and developed 9 steps you need to take to build a great console application ...