How can I publish from Visual Studio 2015 (+U1) ASP.NET Core to IIS on Windows Server 2012R2?
<p>This question could be considered an update of one from two years ago asking how to publish from an open ASP.NET Core solution in visual studio 2015 (<a href="https://stackoverflow.com/questions/25983430/asp-net-vnext-publish-to-iis-in-windows-server">then called ASP.net vnext</a> and briefly also known as ASP.NET 5) to another machine on my local network, which has IIS deployed on it, and which should be used to run the DNX runtime and the ASP.NET application I am writing.  Since the wizard provides no help for me, I believe I will have to completely manually configure either an MSDEPLOY solution and its configuration files, or something else equivalent to it.</p>

<p>The situation has changed a lot since that original question, so I am asking for ASP.NET 5 and DNX 1.0 RC1.  </p>

<p>There are some <a href="https://stackoverflow.com/questions/31571136/remotely-publish-asp-net-5-to-iis">related</a> other <a href="https://stackoverflow.com/questions/27325264/asp-net-5-project-hosting-on-iis">questions</a> that ask how to do this and mentions WebDeploy 3.6 and is also referring to nearly 2 year old beta releases,.</p>

<p>I believe therefore, that this question should have a new and different answer for Visual Studio 2015, now that ASP.NET 5 is at the release candidate and is feature complete. How is it done now?</p>

<p>Also it should be made clear I'm not talking about deploying from my Visual Studio solution on <code>C:\DEV\WORKINGCOPY</code> to my own machine's <code>c:\inetpub\wwwroot</code>, but rather copying across a network, either via web-dav, or FTP or SMB share, to a windows Server box running IIS.</p>

<p>What I have tried so far:</p>

<ul>
<li><p>Use the built in Publish To Web wizard in filesystem mode. The result seems to be something you could run via a web.cmd which will execute dnx and kestrel, but does not build a bundle that is runnable from IIS 8.x on Windows Server 2012.  Furthermore, the publish to filesystem mode creates a bunch of stuff including a basic set of folders named approot, logs, and wwwroot, and I am pretty sure that IIS should not be set up to serve up the approot or logs folders directly. If I look at my copy of the wwwroot\ folder from IIS, I see a 500 - Internal server error. That's what I'd expect IIS to do when it has no idea how to take the web.config in there and do anything with it.</p></li>
<li><p>Tried to use <code>dnu publish</code> and <code>dnu pack</code> manually from a command prompt, with the idea that perhaps I could use the results to replace the contents of my XYZ-publish.ps1 powershell file PublishProfiles.  dnu publish command fails with "bower not recognized as internal or external command".   dnu pack succeeds, but I have no idea what to do with the resulting .nupkg files with regards to getting them to run on IIS.</p></li>
</ul>

<p>My goals in general are:</p>

<ul>
<li><p>To have everything done in one click or by typing one command, including any bundling and building of any pre-compiled-assemblies (nuget packages being the vNext equivalent concept to Assemblies inclassic .net).</p></li>
<li><p>To make clear to myself and other readers what the one time set up tasks on IIS are before you are ready to deploy, and what the tasks are that are done for you each time you click publish, and how to set them up.</p></li>
</ul>

<p>This appears to be a fundamental area where the documentation on ASP.NET 5 at this time is extremely weak, and the tooling is currently optimized only for people who want to deploy a bundle to a folder and run it from "dnx web" (kestrel), or for those who want to deploy on Azure (this process is fully automated for those cases within the Publish wizard) not those who want to deploy to their own machine running IIS.  The publish wizard is missing this extremely obvious (to me) case; Publish to a Windows server box of my own, and create me any IIS scaffolding that I need to get this working.</p>