0

I've made an 'empty' ASP.Net 5 project in Visual Studio 2015. The project.json file contains these lines

"dependencies": {
  "Microsoft.AspNet.IISPlatformHandler": "1.0.0-rc1-final",
  "Microsoft.AspNet.Server.Kestrel": "1.0.0-rc1-final"
},

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

I am testing on a Windows 10 development PC and planning to deploy to Azure and so, following the advice in the docs on Servers, I want to use IIS and not Kestrel.

However ripping Kestrel out is not straightforward. Firstly I remove the Kestrel related lines from the project.json file:

"dependencies": {
  "Microsoft.AspNet.IISPlatformHandler": "1.0.0-rc1-final",
},

"commands": {
},

This fails to build with multiple errors ("The type or namespace name 'Hosting' does not exist in the namespace 'Microsoft.AspNet'", "The type or namespace name 'DependencyInjection' does not exist in the namespace 'Microsoft.Extensions'", "The type or namespace name 'IServiceCollection' could not be found", and "The name 'WebApplication' does not exist in the current context") so I add dependencies to fix the errors, giving the following (which successfully builds)

"dependencies": {
  "EntityFramework.Core": "7.0.0-rc1-final",
  "Microsoft.AspNet.Hosting": "1.0.0-rc1-final",
  "Microsoft.AspNet.IISPlatformHandler": "1.0.0-rc1-final",
  "Microsoft.Extensions.DependencyInjection.Abstractions": "1.0.0-rc1-final"
},

"commands": {
},

However it does not run - just hangs indefinitely but it also adds the line "web": "Microsoft.AspNet.Server.Kestrel" back into the commands in project.json.

What should the dependencies and commands section of a project.json file in a "Hello World" ASP.Net 5 project look like if I do not want to use Kestrel, just IIS / IIS Express?

DavidG
  • 113,891
  • 12
  • 217
  • 223
dumbledad
  • 16,305
  • 23
  • 120
  • 273
  • Should I be posting this question here or over on the aspnet/Hosting GitHub [issues](https://github.com/aspnet/Hosting/issues)? – dumbledad Dec 15 '15 at 10:23

1 Answers1

0

following the advise in the docs on Servers, I want to use IIS and not Kestrel.

This docs a bit outdated. You have to use Kestrel or another http listener supporting asp.net 5. Bigger info about Change to IIS hosting model here

In a nutshell: Launch on IIS works through IISPlatformHandler Module, which works with http listeners such as Kestrel.

Stas Boyarincev
  • 3,690
  • 23
  • 23