我有一个ASP.NET Core应用程序,我刚升级到1.1。这个应用程序以前工作得很好,我可以发布它(通过Visual Studio中的发布命令),它在IIS下工作得很好。我最近改变了这个是1.1,并得到了应用程序罚款运行在调试模式。现在,当我发布,我得到ASP.NET Core 1.1发布时无法运行
502 - Web server received an invalid response while acting as a gateway or proxy server.
我打开失败请求跟踪规则,并在那里我看到了以下
MODULE_SET_RESPONSE_ERROR_STATUS
ModuleName httpPlatformHandler
Notification EXECUTE_REQUEST_HANDLER
HttpStatus 502
HttpReason Bad Gateway
HttpSubStatus 3
ErrorCode The server is currently disabled. (0x8007053d)
我发表的web.config文件看起来像这样
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<handlers>
<remove name="httpPlatform" />
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath="dotnet" arguments=".\Cranalytics.dll" forwardWindowsAuthToken="true" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" />
</system.webServer>
</configuration>
我的project.json文件看起来像这样
{
"dependencies": {
"Microsoft.EntityFrameworkCore.Tools": "1.1.0-preview4-final",
"Microsoft.EntityFrameworkCore": "1.1.0",
"Microsoft.EntityFrameworkCore.InMemory": "1.1.0",
"Microsoft.EntityFrameworkCore.SqlServer": "1.1.0",
"Microsoft.AspNetCore.Diagnostics": "1.1.0",
"Microsoft.AspNetCore.Mvc": "1.1.0",
"Microsoft.AspNetCore.Mvc.TagHelpers": "1.1.0",
"Microsoft.AspNetCore.StaticFiles": "1.1.0",
"Microsoft.AspNetCore.Server.IISIntegration": "1.1.0",
"Microsoft.AspNetCore.Server.Kestrel": "1.1.0",
"Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.0.0-preview2-final",
"Microsoft.Extensions.Caching.Memory": "1.1.0",
"Microsoft.Extensions.Configuration.EnvironmentVariables": "1.1.0",
"Syncfusion.Compression.MVC": "14.2600.0.32-preview2-final",
"Syncfusion.XlsIO.MVC": "14.2600.0.32-preview2-final",
"Microsoft.ApplicationInsights.AspNetCore": "1.0.2",
"Microsoft.Extensions.Configuration.FileExtensions": "1.1.0",
"Microsoft.Extensions.Configuration.Json": "1.1.0",
"Microsoft.Extensions.Logging.Console": "1.1.0",
"Microsoft.Extensions.Logging.Debug": "1.1.0",
"Microsoft.NETCore.App": {
"version": "1.1.0",
"type": "platform"
},
"Microsoft.VisualStudio.Web.BrowserLink.Loader": "14.1.0"
},
"tools": {
"Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.0.0-preview2-final"
},
"frameworks": {
"netcoreapp1.1": {
"imports": [
"dotnet5.6",
"portable-net45+win8"
]
}
//"net461": {
// "dependencies": {
// },
// "imports": "dnxcore50"
//}
},
"buildOptions": {
"emitEntryPoint": true,
"preserveCompilationContext": true
},
"runtimeOptions": {
"configProperties": {
"System.GC.Server": true
}
},
"publishOptions": {
"include": [
"wwwroot",
"web.config",
"appsettings.Production.json",
"appsettings.Staging.json",
"appsettings.json"
]
},
"scripts": {
"postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ]
}
}
我找不出配置或IIS有什么问题。
编辑: 我对配置做了一些更改,现在已经过了模块加载部分(至少根据跟踪日志)。现在,只要访问网站,我就会获得404。我可以查看静态图像没有问题,但是当我查看主页的网站,我收到了404错误
ModuleName AspNetCoreModule
Notification EXECUTE_REQUEST_HANDLER
HttpStatus 404
HttpReason Not Found
HttpSubStatus 0
ErrorCode The operation completed successfully. (0x0)
我出版的目录结构是一个子网站根网站在IIS(/ Cranalytics)下方。然后在那个文件夹中是所有的各种DLL,以及web.config。在这个目录下是项目的wwwroot目录。 IIS子网站被设置为指向根网站(/ Cranalytics)。
为什么旧的IIS包?当前版本是http://www.nuget.org/packages/Microsoft.AspNetCore.Server.IISIntegration.Tools/1.1.0-preview4-final – Tseng
您是否还安装了1.1.0运行时? –
tseng我将它更改为1.1.0-preview4-final Martin我在服务器上安装了DotNetCore.1.1.0-WindowsHosting –