刚刚开始学习 ASP.NET 5 / MVC 6
我很好奇在 IIS 之外自托管这样一个应用程序 - 作为 Windows 服务。
我应该使用 TopShelf 来实现这一点,就像 OWIN/Katana 应用程序的情况一样,还是 ASP.NET 5 通过 NuGet 包提供一些内置的自托管(作为服务)选项?
您可以使用Kestrel https://docs.asp.net/en/latest/fundamentals/servers.html#kestrel自托管库。
添加对库的依赖project.json
file:
"dependencies": {
"EntityFramework.Commands": "7.0.0-rc1-final",
// Dependencies deleted for brevity.
"Microsoft.AspNet.Server.Kestrel": "1.0.0-rc1-final"
}
然后为 Kestrel 指定此命令:
"commands": {
"web": "Microsoft.AspNet.Server.Kestrel"
}
您可以通过命令行从 MVC 项目所在的文件夹启动它:
dnx web
请通知dnvm
必须先运行。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)