title: Global exception filter does not trigger on exception
body: <p>I am new to ASP.NET and C#. I am working with a ASP.NET Core 2.0 MVC app.</p>
  
  <p><strong>Startup.cs</strong></p>
  
  <pre><code>public void ConfigureServices(IServiceCollection services)
  {
     (services, Configuration)
     .RegisterMvc();
  }
  </code></pre>
  
  <p><strong>RegisterMvc method</strong></p>
  
  <pre><code>public static (IServiceCollection services, IConfiguration configuration) RegisterMvc(this (IServiceCollection services, IConfiguration configuration) aspnet)
  {
      var (services, configuration) = aspnet;
  
      services
          .AddMvc(options =&gt;
          {
              options.Filters.Add(new GlobalExceptionFilter());
          });
  
      return aspnet;
  }
  </code></pre>
  
  <p><strong>GlobalExceptionFilter</strong></p>
  
  <pre><code>public void OnException(ExceptionContext context)
  {
      var exception = context.Exception;
      Log.LogError(LogDescription, exception.Message, exception);
  }
  </code></pre>
  
  <p>When an exception occurs, the execution flow needs to go into the OnException method but that is not happening. Ideas, anyone?</p>
  
  <p><strong>Update</strong></p>
  
  <p>This code works just fine, but I need this filter to trigger even when I catch the exception.</p>