Deploying an ASP.Net 5 web application in IIS
The preview of Visual Studio 2015 contains no built in tooling to directly deploy web apps to an IIS, this post describes a way of doing it without tooling.
Prepare project for IIS deploying using command line tools
Running commands can be done from any prompt that has the K tools in the current path. The Package Manager Console from within VS2015 works fine if you have installed the K toolset already.
First off, pack the site you intend to publish by:
1. Make sure you are located in the project root, the folder containing the project.json file.
2. Execute the following ‘kpm pack –out outputDirectory –runtime choosenRuntime‘, for ex ‘kpm pack –out C:\tmp\WebApp –runtime KRE-CLR-amd126.96.36.199-beta1’.
(If you are going to host this on an IIS locally or on a server, use a CLR version of the runtime. If you plan on deploying the package to Azure, use a Core version of the runtime.)
3. Create a new Website in IIS pointing to the chosen outputDirectory/wwwroot. (In our ex above C:\tmp\WebApp\wwwroot)
Happy Hacking! 🙂
Disclamier – This was written for beta-3, some parts have been renamed for beta-4 and onwards!