Is there a way to make a console application run using only a single file in .NET Core? : <p>In .NET framework, you can make a single <code>.EXE</code> file that will run from the command line without having any extra config files (and if using ILMerge, you can put all <code>.DLL</code> references into the 1 <code>.EXE</code> assembly).</p>

<p>I am taking a stab at using .NET Core to accomplish the same thing, but so far without success. Even the simplest <code>Hello World</code> application with no dependencies requires there to be a file named <code>&lt;MyApp&gt;.runtimeconfig.json</code> in order to run using <code>dotnet.exe</code>.</p>

<pre><code>dotnet F:\temp\MyApp.dll
</code></pre>

<p>The contents of the <code>&lt;MyApp&gt;.runtimeconfig.json</code> are as follows:</p>

<pre><code>{
  "runtimeOptions": {
    "framework": {
      "name": "Microsoft.NETCore.App",
      "version": "1.1.1"
    }
  }
}
</code></pre>

<p>Without this config file in the same folder as the <code>.DLL</code>, I get the following error:</p>

<pre><code>A fatal error was encountered. The library 'hostpolicy.dll' required to
execute the application was not found in 'F:\temp'.
</code></pre>

<p>My question is: Is there some way to change the application so it doesn't <em>require</em> this config file to be present, so that the defaults of this information are compiled within the <code>.DLL</code> but can be overridden by adding the config file?</p>

<blockquote>
  <p>NOTE: I also want to ensure it "just works" regardless of the platform it is installed on it provided the platform has the right version of .NET Core.</p>
</blockquote>

<h1>Background</h1>

<p>I am trying to get a smooth user experience for running some utilities that are useful sometimes, but are rarely ever needed. Since it <a href="https://stackoverflow.com/questions/44830430/is-it-possible-to-make-the-same-dll-into-both-a-console-application-and-a-nuget">doesn't appear to be possible to use the same <code>.DLL</code> that is referenced from a client application</a> as a console application, the next best thing would be to have a <em>single file</em> that could be downloaded and run without any dependencies.</p>

<p>For example, in Java you can simply download a <code>.jar</code> file on any supported platform and run:</p>

<pre><code>java &lt;package&gt;.jar &lt;namespace&gt;.SomeClass [args]
</code></pre>

<p>and it will "just work" without any extra files. How can I get a similar user experience using .NET Core?</p>

<p>In a nutshell, I want to try to avoid the extra step of "unzip to a directory first"...</p>
