【发布时间】:2015-10-12 01:25:21
【问题描述】:
我目前正在尝试将我的 ASP.NET 5 MVC 应用程序部署到远程服务器,但无法让它与 IIS 一起正常运行。
我的解决方案 DNX SDK 版本是 1.0.0-beta8-15598。
我已使用dnu publish --runtime active 将这个项目打包在一起,并将 IIS 指向 wwwroot 文件夹。
我的 project.json 看起来像这样
{
"webroot": "wwwroot",
"version": "1.0.0-*",
"dependencies": {
"Microsoft.AspNet.Diagnostics": "1.0.0-beta8-15533",
"Microsoft.AspNet.Mvc": "6.0.0-beta8-15550",
"Microsoft.AspNet.Server.IIS": "1.0.0-beta8-15520",
"Microsoft.AspNet.Server.WebListener": "1.0.0-beta8-15519",
"Dapper": "1.42.0",
"Dapper.SimpleCRUD": "1.8.7",
"Microsoft.Framework.Logging.Console": "1.0.0-beta8-15514",
"Microsoft.Framework.Logging.NLog": "1.0.0-beta8-15514",
"Microsoft.Framework.Configuration.Json": "1.0.0-beta8-15514",
"Microsoft.AspNet.Cors": "5.1.0-rc1",
"Dapper.Contrib": "1.43.0",
"NuGet.CommandLine": "2.8.6"
},
"commands": {
"web": "Microsoft.AspNet.Hosting --server Microsoft.AspNet.Server.WebListener --server.urls http://meep:5001"
},
"frameworks": {
"dnx451": { }
},
"exclude": [
"wwwroot",
"node_modules",
"bower_components"
],
"publishExclude": [
"node_modules",
"bower_components",
"**.xproj",
"**.user",
"**.vspscc"
],
"configurations": {
"Stage": { }
}
}
当我尝试在浏览器中访问远程服务器时遇到的错误如下
[FileNotFoundException: The system cannot find the file specified. (Exception from HRESULT: 0x80070002)]
[InvalidOperationException: Unable to load application or execute command 'Microsoft.AspNet.Loader.IIS'. Available commands: web.]
[TargetInvocationException: Exception has been thrown by the target of an invocation.]
System.Web.HttpRuntime.HostingInit(HostingEnvironmentFlags hostingFlags, PolicyLevel policyLevel, Exception appDomainCreationException) +303
[HttpException (0x80004005): Exception has been thrown by the target of an invocation.]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +9931880
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +101
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +254
我正在运行 Windows Server 2012 -- Windows 6.3.9600。
我不确定如何继续解决这个问题,因为我不确定问题的直接原因,除了它无法load application or execute command 'Microsoft.AspNet.Loader.IIS'
【问题讨论】:
标签: c# asp.net .net asp.net-mvc iis