kho*_*ang 5 azure azure-web-sites asp.net-core
我从asp.net核心2.0开始用VS 2017创建了一个新项目.将它发布到windows azure.我收到错误IIS 502.5

检查日志流,我看到了这一点
未处理的异常:System.FormatException:交换机映射中未定义短开关'-argFile'.在Microsoft.AspNetCore.Hosting的Microsoft.Extensions.Configuration.ConfigurationBuilder.Build()上的Microsoft.Extensions.Configuration.Command.Conmand.Configuration.CommandLine.CommandLineConfigurationProvider.Load()中的Microsoft.Extensions.Configuration.ConfigurationRoot..ctor(IList`1提供程序).位于RecruitmentStore.Host.Program.BuildWebHost(String [] args)的Microsoft.AspNetCore.Hosting.WebHostBuilder.Build()中的WebHostBuilder.BuildCommonServices(AggregateException和hostingStartupErrors)位于D:\ RecruitmentStore\RecruitmentStore.Host\Program.cs:第20行at at RecruitmentStore.Host.Program.Main(String [] args)在D:\ RecruitmentStore\RecruitmentStore.Host\Program.cs:第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>
Run Code Online (Sandbox Code Playgroud)
我看到bin文件夹(在我的本地)内生成的文件IISExeLauncherArgs.txt,但不知道它在Azure中是如何工作的.
你能告诉我如何解决这个问题吗?我确实多次重启了应用服务,这没有用
正如我们发现的那样,问题在于您在项目web.config中只有在Visual Studio中进行本地调试时才会使用.如果从项目中排除它,msbuild将在部署时生成正确的,并且它将在Azure上正确运行.
| 归档时间: |
|
| 查看次数: |
2435 次 |
| 最近记录: |