<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>nenoNaninu</author_name>
  <author_url>https://blog.hatena.ne.jp/nenoNaninu/</author_url>
  <blog_title>ねののお庭。</blog_title>
  <blog_url>https://blog.neno.dev/</blog_url>
  <categories>
    <anon>.NET Core</anon>
    <anon>.NET</anon>
    <anon>C#</anon>
  </categories>
  <description>タイトルが分かりずらいですね、はい。 コンソールアプリ、Main関数が終了すると同時にアプリは終了します。 それはそう、当たり前。 なんですが裏のスレッドでなんか動いてるからアプリは落ちてほしくない、けどMainは終わっとるし別にawaitするべきものもない、みたいなケースは稀に良くあります。 でそういう場合はアプリが落ちないようにConsole.ReadLine();とか仕込むのが常套手段だったりするわけです。 ただまぁ、書き捨てコードにしろConsole.ReadLine();等で対処するのなんか嫌...となったので、ちょっと考えました。 で、出来たのが以下。 同期用と非同期用あります。 …</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fblog.neno.dev%2Fentry%2F2021%2F10%2F23%2F034158&quot; title=&quot;【C#】ConsoleアプリがMain関数の終了と同時に終了しないようにする。 - ねののお庭。&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2021-10-23 03:41:58</published>
  <title>【C#】ConsoleアプリがMain関数の終了と同時に終了しないようにする。</title>
  <type>rich</type>
  <url>https://blog.neno.dev/entry/2021/10/23/034158</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
