title: Publish .NET Core App As Portable Executable
body: <p>I have a simple .net core app and publish it by following command:</p>
  
  <pre><code> dotnet publish -c Release -r win10-x64
  </code></pre>
  
  <p><strong>SqlLocalDbStarter.csproj</strong></p>
  
  <pre><code>&lt;Project Sdk="Microsoft.NET.Sdk"&gt;
  
    &lt;PropertyGroup&gt;
      &lt;OutputType&gt;Exe&lt;/OutputType&gt;
      &lt;TargetFramework&gt;netcoreapp2.1&lt;/TargetFramework&gt;
    &lt;/PropertyGroup&gt;
  
    &lt;ItemGroup&gt;
      &lt;PackageReference Include="Microsoft.Win32.Registry" Version="4.5.0" /&gt;
    &lt;/ItemGroup&gt;
  
  &lt;/Project&gt;
  </code></pre>
  
  <p>When publish process finished dotnet create <code>win10-x64</code> folder at <code>bin\Release</code> folder then after open it the folder contains <code>publish</code> folder and some dll and exe files. </p>
  
  <p>There are some issue for me:</p>
  
  <ul>
  <li>Which one of <code>exe</code> files (inside / outside publish folder) i need to PE app?</li>
  <li>Why when i cut <code>exe</code> file and move it in other place it doesn't run (without message)?</li>
  <li>If I need all of <code>dll</code> files to run application, so there are tow options for me (inside / outside publish folder), inside publish folder size is 66 MB but outside publish folder is 1 MB.</li>
  <li>I want to have a one <code>exe</code> file to run my program without dll files.</li>
  </ul>
  
  <p><a href="https://i.stack.imgur.com/eYgfH.png" rel="noreferrer"><img src="https://i.stack.imgur.com/eYgfH.png" alt="Folder Size Image"></a></p>