13

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?

Victor Hurdugaci
  • 28,177
  • 5
  • 87
  • 103
Cindro
  • 1,055
  • 4
  • 12
  • 23
  • I haven't tried this deployment scenario, yet, but I would imagine IIS 7 (which comes with Windows 7) will not support this. You use to have to repackage vnext apps to get them to run in IIS because no version of IIS supported them out of the box. It's possible IIS 8 does now, but it may actually require an update to Windows 10 to actually use the default deployment. See: https://github.com/aspnet/Home/wiki/Deploy-an-AspNet-vNext-application-to-Microsoft-Azure-websites – Chris Pratt Apr 30 '15 at 16:37
  • I have looked everywhere and I can't find an answer, I am not even sure about Windows 10. Lets say I wanted the app to run on www.mywebsite.com hosted on IIS, how will I go about this? – Cindro Apr 30 '15 at 17:18
  • I think you're looking for [Project "Helios"](http://blogs.msdn.com/b/webdev/archive/2014/02/18/introducing-asp-net-project-helios.aspx). That's the limits of my knowledge on the subject. :) – bricelam Apr 30 '15 at 23:53

2 Answers2

18

Update

As @wickdninja stated, the below is outdated. Use his updated solution instead: https://learn.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 bin\output) 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.
Community
  • 1
  • 1
Victor Hurdugaci
  • 28,177
  • 5
  • 87
  • 103
  • One last thing that can go wrong is using a runtime that the rest of the packages don't like during the beta stage. As of writing, the coreclr is on beta4 on nuget, and beta5 on myget.org pre-release. If your packages are coming from nuget, packages like Microsoft.AspNet.Mvc are on beta4, and in my experience won't run on the beta5 coreclr since a lot of breaking changes are being made. – vcsjones May 01 '15 at 16:29
  • 1
    Thank you, I finally got it to work. I just had to publish the site under .NET Core x64 architecture instead of x86 and it worked. – Cindro May 02 '15 at 00:26
  • [Here](https://docs.asp.net/en/latest/publishing/iis.html) it is suggested to use 'No Managed Code' for app pool. – Baga Mar 03 '16 at 07:56
  • Hi how can I get runtime list? I don't know which runtime should I use – MichaelMao May 12 '16 at 07:46
  • this answer is outdated. See link to docs below for updated info – wickdninja Aug 01 '17 at 18:08
5

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

wickdninja
  • 949
  • 1
  • 10
  • 15
  • There are probably a fair number of points in it for you if you summarize the article. Pointing to documentation on SO is usually frowned upon – crthompson Jan 13 '17 at 19:59
  • 1
    @paqogomez Thanks for the advice. I agree, I could get more points for summarizing the documentation, but since the new https://learn.microsoft.com/en-us/aspnet/core/publishing/iis is a generated document and anyone can contribute to it via the ["edit"](https://github.com/aspnet/Docs/blob/master/aspnetcore/publishing/iis.md) button on the page I would image that any summary I would provide would just as quickly become out dated. When it comes to documentation I'd rather give people accurate information rather than get greedy for points. :) – wickdninja Jan 19 '17 at 16:02
  • 1
    Well, that misses the point of SO. On SO we are never sure if a link is going to be outdated, and we're not sure if information is current. So, we summarize instead of linking and do our best to keep up on our posts and keep the information updated. Happy SO'ing – crthompson Jan 20 '17 at 03:24