使用 web.cmd 在 Windows Server 上运行发布 asp.net core RC1 网站时出现以下错误,
无法加载应用程序或执行命令“Microsoft.AspNet.Server.Kestrel”
发布网站包含运行时。这是我的 project.json 文件,
{
"version": "1.0.0-*",
"compilationOptions": {
"emitEntryPoint": true
},
"dependencies": {
"DocX": "1.0.0.19",
"EntityFramework": "6.1.3",
"EntityFramework.Core": "7.0.0-rc1-final",
"iTextSharp": "5.5.9",
"itextsharp.pdfa": "5.5.9",
"itextsharp.xtra": "5.5.8",
"Microsoft.AspNet.IISPlatformHandler": "1.0.0-rc1-final",
"Microsoft.AspNet.Mvc": "6.0.0-rc1-final",
"Microsoft.AspNet.Mvc.WebApiCompatShim": "6.0.0-rc1-final",
"Microsoft.AspNet.Server.Kestrel": "1.0.0-rc1-final",
"Microsoft.AspNet.StaticFiles": "1.0.0-rc1-final",
"Microsoft.Extensions.Configuration.FileProviderExtensions": "1.0.0-rc1-final",
"Microsoft.Extensions.Configuration.Json": "1.0.0-rc1-final",
"Microsoft.Extensions.Logging": "1.0.0-rc1-final",
"Microsoft.Extensions.Logging.Console": "1.0.0-rc1-final",
"Microsoft.Extensions.Logging.Debug": "1.0.0-rc1-final",
"Microsoft.Net.Http": "2.2.22",
"Newtonsoft.Json": "8.0.3"
},
"commands": {
"web": "Microsoft.AspNet.Server.Kestrel"
},
"frameworks": {
"dnx451": {
"dependencies": {
"WebApi.Core": "1.0.0-*"
},
"frameworkAssemblies": {
"System.Data": "4.0.0.0",
"System.Drawing": "4.0.0.0",
"System.Messaging": "4.0.0.0",
"System.Transactions": "4.0.0.0"
}
}
},
"exclude": [
"wwwroot",
"node_modules"
],
"publishExclude": [
"**.user",
"**.vspscc"
]
}
发布内容具有作为 nuget 包添加的依赖项“WebApi.Core”。实际上它是我解决方案中的另一个类库项目。
我已经尝试过 dnu restore 但它给 WebApi.Core 依赖项带来了问题。
相同的发布内容在我的 Windows 10 本地机器上运行良好。如果你们有任何解决方案来解决这个问题,请告诉我。