Run ASP.NET 5 (MVC 6) using .NET Core on IIS

I have just created a quick ASP.NET 5 MVC 6 app on Visual Studio.NET 2015 RC and would like it to run on my IIS web server on Windows 7.

Normally, when I create a website on IIS, I need to choose an Application Pool, either v2.0 or v4.0 Integrated.

Now because .NET Core comes with all its libraries as nuget packages, how can I run it on IIS? which application pool do I pick? how does this work?

Answers:

Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.

Method 1

Update

As @wickdninja stated, the below is outdated. Use his updated solution instead: https://docs.microsoft.com/en-us/aspnet/core/publishing/iis
To get the application to run on IIS:


  1. Create a website under a v4.0 app pool.
  2. Bundle/publish the application using dnu publish. This will create a self contained package that has the application, the runtime and all the dependencies. Change the runtime name to match the runtime of your choice.
      dnu publish --runtime dnx-coreclr-win-x86.1.0.0-beta5-11625

    You can even pass --no-source if you don’t want the application to be compiled from sources every time it starts.

  3. Copy the bundle (from binoutput) under the website root.
  4. Run

Things that might go wrong:

  1. The IIS bitness (32/64 bit) must match the bitness of coreclr.
  2. If you don’t copy the bundled website under the website root, make sure the account under which IIS runs can actually access the runtime folder.

Method 2

This question is out of date, and Microsoft has since release pretty thorough documentation for this scenario. You can find it here: https://docs.microsoft.com/en-us/aspnet/core/publishing/iis


All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x