我开始使用asp.net core 2.0,并用VS 2017创建了一个新项目。将其发布到Windows Azure时,出现了IIS 502.5错误。
检查日志流,我发现如下错误:
未处理的异常:System.FormatException: 短开关“-argFile”在开关映射中未定义。
at Microsoft.Extensions.Configuration.CommandLine.CommandLineConfigurationProvider.Load()
at Microsoft.Extensions.Configuration.ConfigurationRoot..ctor(IList`1 providers)
at Microsoft.Extensions.Configuration.ConfigurationBuilder.Build()
at Microsoft.AspNetCore.Hosting.WebHostBuilder.BuildCommonServices(AggregateException& hostingStartupErrors)
at Microsoft.AspNetCore.Hosting.WebHostBuilder.Build()
at RecruitmentStore.Host.Program.BuildWebHost(String[] args) in D:\RecruitmentStore\RecruitmentStore.Host\Program.cs:line 20
at RecruitmentStore.Host.Program.Main(String[] args) in D:\RecruitmentStore\RecruitmentStore.Host\Program.cs:line 17
IIS详细错误 - 502.5 - 错误网关。
以下是我的web.config。
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
</handlers>
<aspNetCore requestTimeout="00:20:00"
processPath="bin\IISSupport\VSIISExeLauncher.exe"
arguments="-argFile IISExeLauncherArgs.txt"
forwardWindowsAuthToken="false"
stdoutLogEnabled="true"
stdoutLogFile="\\?\%home%\LogFiles\stdout"/>
<directoryBrowse enabled="true" />
</system.webServer>
</configuration>
我在本地的bin文件夹里看到了生成的IISExeLauncherArgs.txt文件,但不知道它在Azure上如何工作。
请问您如何解决这个问题?我已经多次重启应用服务,但没有帮助。