Showing posts from May, 2020

NLog 4.6.2 Console Application

For most of our configuration we use the App.config file. If you do not have one, create one and copy a .csproj project’s build configs for handling App.config files or simply start a project with App.config in the visual studio template. Based on .Net framework Console Applications under the .Net 4.7.2 Framework using NLog 4.6.2 however later versions may work just as well. In the start of the App.config add the following... < configSections >     < section name= "nlog" type= "NLog.Config.ConfigSectionHandler, NLog" />   </ configSections >   < nlog throwExceptions= "true" xmlns= "" xmlns:xsi= "" >     < targets >           < target name= "database" xsi:type= "Database" dbProvider= "System.Data.SqlClient"               connectionString= "$ {gdc:item=databaseStr} "