I am starting with asp.net core 2.0 Created a new project with VS 2017. Published it to the windows azure. I got the error IIS 502.5
Check the log stream, I see this
Unhandled Exception: System.FormatException: The short switch '-argFile' is not defined in the switch mappings. 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 Detailed Error - 502.5 - Bad Gateway
And here is my 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>
I see the file IISExeLauncherArgs.txt generated inside the bin folder (in my local), but have no idea how it works in Azure.
Can you please tell me how to fix this? I did restarted the app service several times, that doesn't help
500.32 ANCM Failed to Load dll The app doesn't start. The most common cause for this error is that the app is published for an incompatible processor architecture. If the worker process is running as a 32-bit app and the app was published to target 64-bit, this error occurs.
To access App Service diagnostics, navigate to your App Service web app or App Service Environment in the Azure portal. In the left navigation, click on Diagnose and solve problems.
As we found, the problem is that you have as part of your project a web.config
that is only meant to be used when debugging locally in Visual Studio. If you exclude it form the project, msbuild will generate the correct one at deployment time, and it will run correctly on Azure.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With