title: ConfigureAwait(false) and events in library code
body: <p>So I know that I should use <code>ConfigureAwait(false)</code> in library code in general. Exception is when I know that continuation will need caller context.
  However, I don't know what should I do if I <em>do not know</em> it'll be the case. I am guessing that I should not use <code>ConfigureAwait(false)</code> in such case - however I'd like to confirm this.</p>
  
  <p>Example: my class has few events:</p>
  
  <pre><code>public static event TriggeredWebhookInfo WebhookTriggered;
  public static event ReadonlyWebhookInfo WebhookCancelled;
  </code></pre>
  
  <p>And there's a method (it's <code>private</code> as it's called by a <code>public Task</code> returning method, but it also uses <code>ConfigureAwait(false)</code>):</p>
  
  <pre><code>private static async Task&lt;HttpResponseMessage&gt; TriggerTaskAsync(string url, WebhookBody body)
  {
      if (body == null || url == null)
      {
          WebhookCancelled?.Invoke(url, body);
          Logger.Write(InternalTag.Sender, "Webhook cancelled: " + url, LogType.Normal);
          return null;
      }
      HttpResponseMessage response = await Client.PostAsync(url, GetContent(body)).ConfigureAwait(false);
      WebhookTriggered?.Invoke(url, body, response);
      Logger.Write(InternalTag.Sender, "Webhook triggered: " + url, LogType.Normal);
      return response;
  }
  </code></pre>
  
  <p>Now, of course this works completely fine for any terminal application. However, what would happen if event invokes method on UI context assigned by user in a non-terminal application? Will <code>Invoke()</code> mitigate any issues, or should I remove <code>ConfigureAwait(false)</code> from the call stack to this method?</p>