This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0" encoding="utf-8" ?> | |
| <nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd" | |
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
| xsi:schemaLocation="http://www.nlog-project.org/schemas/NLog.xsd NLog.xsd" | |
| autoReload="true" | |
| throwExceptions="false" | |
| internalLogLevel="Off" internalLogFile="C:\Windows\Temp\ConsoleApplication\nlog-internal.log" > | |
| <time type="FastUTC" /> | |
| <targets> | |
| <target name="file" xsi:type="File" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class GlobalExceptionFilter : IExceptionFilter | |
| { | |
| private readonly ILogger<ExampleExceptionFilter> _logger; | |
| public ExampleExceptionFilter(ILogger<ExampleExceptionFilter> logger) | |
| { | |
| _logger = logger; | |
| } | |
| public void OnException(ExceptionContext context) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class ExampleExceptionFilter : IExceptionFilter | |
| { | |
| private readonly ILogger<ExampleExceptionFilter> _logger; | |
| public ExampleExceptionFilter(ILogger<ExampleExceptionFilter> logger) | |
| { | |
| _logger = logger; | |
| } | |
| public void OnException(ExceptionContext context) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public static class Program | |
| { | |
| private static readonly CancellationTokenSource TokenSource; | |
| static Program() | |
| { | |
| TokenSource = new CancellationTokenSource(); | |
| Console.CancelKeyPress += (sender, args) => | |
| { | |
| TokenSource.Cancel(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public static class Program | |
| { | |
| private static readonly CancellationTokenSource TokenSource; | |
| static Program() | |
| { | |
| TokenSource = new CancellationTokenSource(); | |
| Console.CancelKeyPress += (sender, args) => | |
| { | |
| TokenSource.Cancel(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public static class Program | |
| { | |
| private static readonly CancellationTokenSource TokenSource; | |
| static Program() | |
| { | |
| TokenSource = new CancellationTokenSource(); | |
| Console.CancelKeyPress += (sender, args) => | |
| { | |
| TokenSource.Cancel(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ErrorActionPreference = "Stop" | |
| Set-ExecutionPolicy Bypass -Scope Process -Force; | |
| ## Install Chocolatey | |
| Invoke-Expression ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')) | |
| ## Install packages | |
| # Web |