title: error NETSDK1097 requesting a RuntimeIdentifier when moving from .Net Core 3 to .Net 5
body: <p>I am building single file executables for both MacOS (osx-x64) and Windows (win-x64).</p>
  <p>My command line is:</p>
  <blockquote>
  <p>dotnet publish --nologo -r osx-x64 -c Release /p:PublishSingleFile=true /p:PublishTrimmed=true</p>
  </blockquote>
  <p>When moving to .Net 5, I am now getting this error:</p>
  <blockquote>
  <p>/usr/local/share/dotnet/sdk/5.0.100-preview.7.20366.6/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.RuntimeIdentifierInference.targets(142,5):
  error NETSDK1097: It is not supported to publish an application to a
  single-file without specifying a RuntimeIdentifier. You must either
  specify a RuntimeIdentifier or set PublishSingleFile to false.</p>
  </blockquote>
  <p>So I decided to add the RuntimeIdentifier section:</p>
  <pre><code>&lt;RuntimeIdentifiers&gt;osx-x64;win-x64&lt;/RuntimeIdentifiers&gt;
  </code></pre>
  <p>It turns out that this needs to be in every sub-project.. a bit annoying but ok.</p>
  <p>But now, it doesn't work:</p>
  <blockquote>
  <p>Applications published to a single-file are required to use the application host. You must either set PublishSingleFile to false or set UseAppHost to true.</p>
  </blockquote>
  <p>Additionally, if I add all on the command line:</p>
  <blockquote>
  <p>dotnet publish --nologo -c Release /p:PublishSingleFile=true /p:PublishTrimmed=true /p:UseAppHost=true /p:RuntimeIdentifier=osx-x64 -r osx-x64</p>
  </blockquote>
  <p>I get the same error. It looks like the config on the dotnet command line gets ignored.</p>
  <p>Adding the runtime identifier to all the project files, yields:</p>
  <blockquote>
  <p>error MSB6006: &quot;dotnet&quot; exited with code 1.</p>
  </blockquote>
  <p>which doesn't really say anything.</p>
  <p>My question is:</p>
  <p>has the behavior changed with .NET 5 (I can't find anything on the topic), or is the preview that is broken?</p>