How to Get ASP.NET 5 Apps To Run Under IIS
Recently I've been working on a web application using ASP.NET 5 and today had to deploy it to a web server in our test environment. Here are the steps I took to get this to work:
- Published the website project in Visual Studio 2015 by right-clicking on the project and selecting "Publish", I used the file system publish option, and specified the 64-bit version of the runtime we're using (in this case, 1.0.0-beta5). This is important, as I was unable to get IIS to host this website using the x86 version. I specified a path outside of the solution directory for the publish output. Inside the publish directory, the publish process created 2 folders -- approot and wwwroot, as well as a file called web (no extension), and web.cmd.
- On the web server, I created a new folder for the website. Inside this folder, I placed the output from the publish (the approot and wwroot folders and the two web files).
- I created a new website in IIS on the web server. For the app pool, I selected .NET 4. For the physical directory, I selected the location of the wwwroot folder underneath the website folder (not the main wwwroot folder). For example, the physical path looked like c:\inetpub\wwwroot\mywebsite\wwwroot.
And that did the trick.