title: Configure .netcore project as portable, but publish as selfcontained
body: <p>I know that it is possible to build/publish .NET Core applications in 2 different ways, namely: <strong>Portable application</strong> (<code>&quot;type&quot;: &quot;platform&quot;</code>) and <strong>Self-contained application</strong> (<code>&quot;type&quot;: &quot;build&quot;</code>).</p>
  <p>When I create a new application using <code>dotnet new</code>, <code>project.json</code> by default is set up for the Portable application:</p>
  <pre><code>&quot;frameworks&quot;: {
      &quot;netcoreapp1.1&quot;: {
        &quot;dependencies&quot;: {
          &quot;Microsoft.NETCore.App&quot;: {
            &quot;type&quot;: &quot;platform&quot;,
            &quot;version&quot;: &quot;1.1.0&quot;
          },
          &quot;Microsoft.FSharp.Core.netcore&quot;: &quot;1.0.0-alpha-160629&quot;
        }
      }
    }
  </code></pre>
  <p>And it means that my application will depend on the runtime, which is installed on the machine, where I am going to run the application.</p>
  <p>But what if I decide, that I want to publish this application in both Portable and Self-contained modes?
  When I set the type to be <code>build</code> and try to run the application, I receive an error, which, I guess, is expected:</p>
  <blockquote>
  <p>C:\temp\testproj&gt;dotnet restore &amp;&amp; dotnet run</p>
  <p>log : Restoring packages for C:\temp\testproj\project.json...</p>
  <p>log : Restoring packages for tool 'dotnet-compile-fsc' in  C:\temp\testproj\project.json...</p>
  <p>log  : Lock file has not changed. Skipping lock file write. Path:  C:\temp\testproj\project.lock.json</p>
  <p>log  : C:\temp\testproj\project.json</p>
  <p>log  : Restore completed in 1973ms.</p>
  <p>Can not find runtime target for framework '.NETCoreApp,Version=v1.1' compatible with one of the target runtimes: 'win10-x64, win81-x64, win8-x64, win7-x64'. Possible causes:</p>
  <ol>
  <li><p>The project has not been restored or restore failed - run <code>dotnet restore</code></p>
  </li>
  <li><p>The project does not list one of 'win10-x64, win81-x64, win8-x64, win7-x64' in the 'runtimes' section.</p>
  </li>
  <li><p>You may be trying to publish a library, which is not supported. Use <code>dotnet pack</code> to distribute libraries.</p>
  </li>
  </ol>
  </blockquote>
  <p>And to make it work I can set add a <code>runtimes</code> section in <code>project.json</code>, which will list my current machine's architecture as one of the supported.</p>
  <p><strong>The question is:</strong>
  Is there a way to publish the application both as self-contained and portable without changing <code>project.json</code> each time?</p>