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?