<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>neko3cs</author_name>
  <author_url>https://blog.hatena.ne.jp/neko3cs/</author_url>
  <blog_title>ねこさんのぶろぐ</blog_title>
  <blog_url>https://blog.neko3cs.net/</blog_url>
  <categories>
    <anon>.NET</anon>
    <anon>C#</anon>
    <anon>備忘録</anon>
  </categories>
  <description>.NET5.0のコンソールアプリケーションを.NET6.0にアップグレードしてTop-Level Statementを利用しようとしたときに起きた問題です。 最上位レベルのステートメントが含まれているファイルには、そのファイルの最後の最上位レベルのステートメントの後に、名前空間と型を含めることもできます。 docs.microsoft.com これめちゃくちゃ重要な文言でしたが見落とし、ハマってしまいました。 起きたこと .NET5.0で作成した以下のようなコードがありました。 using System; namespace MyProject { public static class Pr…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fblog.neko3cs.net%2Fentry%2Fmistake-of-top-level-statement-with-namespace&quot; title=&quot;C#のTop-Level Statementでハマった話 - ねこさんのぶろぐ&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>2022-05-01 01:19:37</published>
  <title>C#のTop-Level Statementでハマった話</title>
  <type>rich</type>
  <url>https://blog.neko3cs.net/entry/mistake-of-top-level-statement-with-namespace</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
