title: Visual Studio 2017 ASP.Net Publish Self-Contained Dot Net Core App
body: <p>I have a .Net Core ASP.Net application in Visual Studio 2017.  I am trying to do a self contained deployment of the application.</p>
  
  <p>If I run the following command from the CLI it works exactly how I want and produces a .exe</p>
  
  <pre><code>dotnet publish -c release -r win7-x64
  </code></pre>
  
  <p>However if I publish from Visual Studio 2017 it does not produce a .exe and produces a .dll instead.  </p>
  
  <p>How can I replicate the -r win7-x64 of the dotnet publish command from within Visual Studio 2017?</p>
  
  <p>Here is the contents of my .pubxml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;!--
  This file is used by the publish/package process of your Web project. You can customize the behavior of this process
  by editing this MSBuild file. In order to learn more about this please visit https://go.microsoft.com/fwlink/?LinkID=208121. 
  --&gt;
  &lt;Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"&gt;
    &lt;PropertyGroup&gt;
      &lt;WebPublishMethod&gt;FileSystem&lt;/WebPublishMethod&gt;
      &lt;PublishProvider&gt;FileSystem&lt;/PublishProvider&gt;
      &lt;LastUsedBuildConfiguration&gt;Release&lt;/LastUsedBuildConfiguration&gt;
      &lt;LastUsedPlatform&gt;Any CPU&lt;/LastUsedPlatform&gt;
      &lt;SiteUrlToLaunchAfterPublish /&gt;
      &lt;LaunchSiteAfterPublish&gt;True&lt;/LaunchSiteAfterPublish&gt;
      &lt;ExcludeApp_Data&gt;False&lt;/ExcludeApp_Data&gt;
      &lt;PublishFramework&gt;netcoreapp1.1&lt;/PublishFramework&gt;
      &lt;ProjectGuid&gt;74bc47dd-6787-420d-804f-3f3d689d5ae5&lt;/ProjectGuid&gt;
      &lt;publishUrl&gt;C:\Deploy\JLM.MS.LeadGen.Dealer&lt;/publishUrl&gt;
      &lt;DeleteExistingFiles&gt;True&lt;/DeleteExistingFiles&gt;
      &lt;RuntimeIdentifiers&gt;win7-x64&lt;/RuntimeIdentifiers&gt;
    &lt;/PropertyGroup&gt;
  &lt;/Project&gt;
  </code></pre>