1

I just created another test project in VS 2015 using ASP.NET 5 MVC 6. Last time I was using beta-7 of the runtime. This time however, I am using RC1.

project.json file for RC1 version:

"commands": {
    "web": "Microsoft.AspNet.Server.Kestrel"
  }

project.json file for beta-7 version:

"commands": {
    "web": "Microsoft.AspNet.Hosting --config hosting.ini"
  }

Kestrel is a mono platform and I have no idea why the default template would set this up as opposed to IIS or IIS Express? Can someone explain how to correctly configure IIS (preferable) and IIS Express for Web apps running on RC1? Although the RC1 site is running and showing in the IIS Express task bar, why the Kestrel config entry?

What are the steps to switch to full IIS and CoreCLR?

IrishChieftain
  • 15,108
  • 7
  • 50
  • 91

1 Answers1

1

ASP.NET 5 ships with support for 3 different servers:

Microsoft.AspNet.Server.IIS
Microsoft.AspNet.Server.WebListener (WebListener)
Microsoft.AspNet.Server.Kestrel (Kestrel)

You can configure your application to be hosted by any or all of these servers by specifying commands in your project.json file.

When launching a server, you can provide it with some configuration options. This can be done directly using command line parameters, or a configuration file containing the settings can be specified. The Microsoft.AspNet.Hosting command supports parameters for the server to use (such as Kestrel or WebListener) as well as a server.urls configuration key, which should contain a semicolon-separated list of URL prefixes the server should handle.

The project.json file demonstrates how to pass the server.urls parameter directly:

"kestrel": "Microsoft.AspNet.Hosting --server Kestrel --server.urls http://localhost:5004"

Alternately, a configuration file can be referenced, instead:

"kestrel": "Microsoft.AspNet.Hosting --config hosting.ini"

Then, hosting.ini can include the settings the server will use (including the server parameter, as well):

server=Kestrel
server.urls=http://localhost:5000

Reference and more detailed information here: http://docs.asp.net/en/latest/fundamentals/servers.html

Also, the Configure() method in new Startup class allows specifying which handler to use and you can specify app.UseIISPlatformHandler() with appropriate parameters to use IIS hosting.

Your application is most likely running under IIS (express) hosting because you might have IIS or IIS Express selected in the "Run" option (in the toolbar at the top in Visual Studio). If you want to use Kestrel, change that to "web" and then it will pick what's specified in the project.json configuration under command->web.

Chrysalis
  • 4,130
  • 2
  • 21
  • 23
  • What is the process to change server and runtime to IIS with CoreCLR? – IrishChieftain Jan 04 '16 at 23:36
  • Microsoft.AspNet.Server.IIS bombs out - browser just keeps spinning. – IrishChieftain Jan 08 '16 at 18:59
  • Did you try putting a debug point in Startup.cs->Configure() and identify if it complains in there? – Chrysalis Jan 11 '16 at 14:34
  • Site is working but I have no idea how to use IIS. Per the documentation from link you provided: "Working with IIS as your server for your ASP.NET application is the default option.." Obviously this is not the case. I simply need a series of steps to set up IIS to be default server. Do I HAVE to use Kestrel? – IrishChieftain Jan 12 '16 at 17:39
  • "dnvm list" shows 1.0.0-rc1-update1 as default but project.json indicates Kestrel "1.0.0-rc1-final". Site dies and only way to get it running again is by debugging. – IrishChieftain Jan 12 '16 at 18:30
  • Oleg's answer here (http://stackoverflow.com/questions/34553386/the-dependency-1-0-0-rc1-update1-could-not-be-resolved) helped me piece it together but am still finding the official documentation sorely lacking. – IrishChieftain Jan 13 '16 at 17:55