Repository navigation
HTTP Error 502.5 - Process Failure" asp.net core 2 error in Azure #406
Description
Activity
- changed the title
[-]HTTP Error 502.5 - Process Failure" asp.net core error in Azure[/-][+]HTTP Error 502.5 - Process Failure" asp.net core 2 error in Azure[/+]on Aug 16, 2017 @CharlBest Could you please turn on logging from web.config and collect Windows event log? Those logs will give the hint on why the failure happens.
@pan-wang how would I do that? Firstly I don't have a web.config file in my solution and secondly not sure what code to write. Can you please specify?
@pan-wang I got this from my Log Stream on Azure. Hope it helps

The web.config is produced by the publish step if none is provided in the solution. You need to modify the
stdoutLogEnabledvalue in the line line<aspNetCore processPath="dotnet" arguments=".\App.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" />to
trueand make sure the directory specified instdoutLogFileexists.Reacted by Mike Bovenlander, tvkit, Joey Goertzen and BillyMore specifically, you'll need to use Kudu Console (https://{yourapp}.scm.azurewebsites.net/), go to site\wwwroot, and edit the web.config you see in there.
Thanks @davidebbo. I used the new awesome App Service Editor (Preview). Really really nice. Feels like VS Code on the web. Very impressed. Anyway got this message in my logs:
Unhandled Exception: System.IO.FileLoadException: Could not load file or assembly 'Microsoft.AspNetCore.Hosting.Abstractions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
at Things.Api.Program.Main(String[] args)This could be potentially a problem with the runtime store containing mismatching binaries. Let me see if I can reproduce the issue.
Ok cool. Thanks @JunTaoLuo Let me know if I can do something :)
See https://stackoverflow.com/questions/44550096/asp-net-core-2-0-on-azure-results-in-a-502-5. That issue relates to having old things leftover from previous 1.x deployment. Can you try wiping out wwwroot and deploying clean?
Reacted by CameronKnudson, Oswald Umeh, elfalem, Georg Dangl, froitag, Alexander Komarov, Matthias Langhard, Mike Bovenlander, Nick Orlando, Dino and 4 moreReacted by CameronKnudson, Matthias Langhard, Daniel Oliveira and AzamatReacted by CameronKnudson, Matthias Langhard and AzamatReacted by CameronKnudson, Alexander Komarov, Matthias Langhard and AzamatYayyyyy @davidebbo Its working. Thank you.
- I couldn't understand why you would want me to wipe the wwwroot folder as it only contains static web stuff. Then I saw that all die dll files are also in a folder called WWWROOT.
- I removed the wwwroot folder (not emptying it and leaving the empty folder) and got a deployment error. Re-added an empty WWWROOT folder and deployment was happy.
But it looks like its working now. Tested with my API app and will update this comment if the Web app also works but I think it will.
You guys are awesome. Thank you so much for the quickly replies. 👍
Update:
Web App Service is also up and running after clearing the wwwroot folder. Thanks again.Reacted by Grant Morgan, Darren Neimke, Oswald Umeh, cbfrank and Anton VildyaevAwesome! @pan-wang, we can probably close this, and hopefully others running into it will find the issue.
Unfortunately, it's more an msdeploy issue (leaving dirty files) then an Azure or Core issue.
Reacted by Darren Neimke- Reacted by Muhammad Ihsan and KaramHaroun
Hi all,
-
where is the physical path of '.\logs\stdout' ? Under LogFiles? Where we have to create the folder stdout?
-
Previously we have used
UseSetting("detailedErrors", "true")
CaptureStartupErrors(true)
to output errors. Now this does not work anymore.
My general feedback on diagnostics:
In general, figuring out of such kind of errors is extremely complex. We have to use advanced tools to find very simple errors. Then, we have to do lot of configuration (enable diagnostics etc.)
At the end we have too many sources like logstream, application logfiles, eventlog files, Detailed Errors (which is nothing that HTML page shown to the user. It means it is not detailed), dumps,..Last but not least, at the moment of writing of this, I still do not know what is my error. :)
My expectation is following:
- Application Fails.
- Admin LogsOn to portal and see the error.
No configuration, no web.config changes, no KUDU.
Thanks
Reacted by michael-freidgeim-webjet-
13 remaining items
Hi,
Have you fixed it ?
Here is the solution https://youtu.be/rAA1FVA0fog- thank you! demo is verry good…On Thu, Dec 14, 2017 at 11:54 PM, Pluto Solutions ***@***.***> wrote: Hi, Can you fix it ? Here is the solution https://youtu.be/rAA1FVA0fog — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <#406 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AK9w3o6uaX2mUQLwVUwC1i5Q4biPAT26ks5tAVK2gaJpZM4O5Fbb> .
You are welcome.
is there a different command to do Framework Dependent Deployment. Its recommended. @PlutoSolutions \
I ran through the same issue today and have fixed by changing web.config file.
https://stackoverflow.com/questions/38624453/asp-net-core-1-0-on-iis-error-502-5/48761913#48761913Reacted by Agnimitra Kumar Sinha and Vahid Amiri MotlaghI my case was a .Net framework that was not installed in the IIS server.
My project have the .Net Framework 4.6.1 as target... so I install the .Net Framework 4.6.1 in the server and the problem is solved.
Reacted by Adrián FerreiraDoes Azure support Microsoft.AspNetCore.All (2.0.6) yet? I am having the same issue when deploying a newly created project from Visual Studio 2017 15.6.2. Microsoft.AspNetCore.All (2.0.6) is what ships with this version of Visual Studio 2017. The issue can easily be reproduce by following these steps:
- Open Visual Studio.
- Click File > New > Project.
- Select .NET Core and choose ASP.NET Core Web Application.
- Leave other defaults and click OK.
- Select API, click OK.
- Right-click project, select Publish....
- Click Publish.
- Ensure app service settings are complete, click Create.
- The publish succeeded, however, the Site Url throws a 502.5 Error.
Attempting to downgrade to < 2.0.6 doesn't work; publishing will throw an error.
Severity Code Description Project File Line Suppression State Error The command ""dotnet" exec --runtimeconfig "C:\Users\Hayden Hancock\source\repos\WebApplication2\WebApplication2\bin\Release\netcoreapp2.0\WebApplication2.runtimeconfig.json" --depsfile "C:\Users\Hayden Hancock\source\repos\WebApplication2\WebApplication2\bin\Release\netcoreapp2.0\WebApplication2.deps.json" "C:\Program Files\dotnet\sdk\NuGetFallbackFolder\microsoft.aspnetcore.mvc.razor.viewcompilation\2.0.3\build\netstandard2.0\Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.dll" @"obj\Release\netcoreapp2.0\microsoft.aspnetcore.mvc.razor.viewcompilation.rsp"" exited with code 1. WebApplication2 0It won't let me post what my web.config looks like from the App Service Editor.
The deployment is not complete, see Azure/app-service-announcements#92
The deployment is now complete.
Reacted by Hayden Hancock@davidebbo Thanks for the update. I will attempt another deployment when I am able and let you know the result.
I attempted a deployment using Visual Studio 2017 15.5.7 which ships with Microsoft.AspNetCore.All (2.0.5) and I still have issues (http://webapplication320180316115814.azurewebsites.net/).
Any reason, that you are aware of, that would cause downgrades of Microsoft.AspNetCore.All to cause build issues with Visual Studio 2017 15.6.2?
@haydenhancock I think it would be best to open a new issue to discuss. This one looks like it's been already used for various unrelated issues (even if they all happen to end up with a Process Failure), and it's been closed for a while. Also, please include a sample repo to make it easier to investigate. Thanks!
Reacted by Hayden Hancock@davidebbo Done #681. Thanks!
If anyone happens to get this far in the comments and is having the same issue, check to see if the correct .NET SDK is installed on the server you are publishing to.
In my case, all I had to do was install the .NET Core 2 SDK and the API started working after my upgrade.
Reacted by Weihui GuoThis just started happening out of nowhere and a quick investigation revealed that it's having trouble finding the Microsoft.AspNetCore.Antiforgery library which I don't use. I don't have any problems on my dev env, this is only happening on the staging server.
I have found a couple of workarounds but what I care about right now if anybody knows why this is happening. I'm about to go live with a project using .net core the first time and I cannot afford this happening on production.
If a project dll name contains space, why will it cause 502 error? For example "my web api.dll" (assembly name in VS) causes the error but "mywebapi.dll" works perfect. I spent millions seconds to figure out a workaround to fix the error. In VS, a dll name with space runs ok but as soon as it is published, it won't work with "HTTP Error 502.5 - Process Failure".
Azure documents may have the naming convention such as "do not have space in assembly name" i don't know.

I updated my projects from .NET Core 1.1 to .NET Core 2.0.
I then deploy my API app and Web app via Visual Studio 2017 15.3 web deploy and now have these errors when visiting my apps.
I have tried the possible fix mentioned in this Stack Overflow post but it doesn't seem to work. https://stackoverflow.com/questions/45694286/net-core-2-0-azure-app-service-502-5-error/45715420#45715420
This was a problem in the past here: #252
I also spoke to @davidebbo about this in Azure/app-service-announcements-discussions#6 (comment)
Thanks in advance.