72

I have a .NET Core application. It runs locally with VS2017 and Kestrel. It runs locally under IIS. However, on the server it fails to start with a 502.5 - Process Failure message.

In the event logs I get more detail:

Application '...' with physical root 'C:...\my-app-folder\' failed to start process with commandline '"dotnet" .\MyApp.dll', ErrorCode = '0x80004005 : 80008083.

Previous builds of the application work fine on the same server, the only difference being that they were published with VS2017RC (2&3) and this is the first build with the fully released VS2017.

What does ErrorCode = '0x80004005 : 80008083. mean?

How do I fix it?

Keith
  • 150,284
  • 78
  • 298
  • 434
  • 1
    have you updated to the [.NET Core 1.0.4 SDK 1.0.1](https://github.com/dotnet/core/blob/master/release-notes/download-archives/1.0.4-download.md) on Server? VS2017RC is shipped with this version. – Set Mar 10 '17 at 08:59
  • @Set installing that worked, cheers. – Keith Mar 10 '17 at 09:41

13 Answers13

53

For now, there is a simple way to see what the actual error is. Open Console section from the App service, then try to run the dotnet app. From there we may get the full error message and trace info: enter image description here

thangcao
  • 1,819
  • 1
  • 13
  • 14
  • Cheers, but it wasn't getting as far as giving me a stack trace - it falling over before even getting into managed code. – Keith Apr 10 '18 at 18:02
  • 8
    What is this 'app service' you speak of and where do I find it? – David van Dugteren May 02 '18 at 10:43
  • I had this issue which I think occurred when a new version of .netstandard was released and I upgraded my webapi to it before redeploying. The easy 'fix' was then to change the deployment mode to "self-contained" (In the Visual Studio, publish page, choose "Configure" then "Settings" on the Publish dialog and set "Deployment mode" to "Self contained" – NeilMacMullen May 08 '18 at 10:30
  • 2
    this is the best way to get a nice/understandable error message! +1 – sebagomez Jun 10 '18 at 04:16
  • Broken image! could you fix it? – IEnjoyEatingVegetables Aug 08 '18 at 14:36
  • Fixed it for me perfectly, clean -> rebuild -> `dotnet ./proj/.../bin/debug/MyDll.dll` and it printed everything I needed to know. I got to this thread from looking on my `Kudu` Diagnostic console via Azure, `Diagnostic Console` -> `LogFiles/eventlog.xml` and the error message was right at the bottom. – James Gould Jan 28 '19 at 13:15
  • 2
    The seems applicable only for Azure App Service – Markus Jun 26 '19 at 12:00
27

Error code: 0x80004005 means a file missing or can't be accessed.

Sub-code: 80008083 appears to be a version conflict.

This error means a different version of dotnet needs to be installed on the server.

Keith
  • 150,284
  • 78
  • 298
  • 434
  • 7
    Where can I find a reference for those errors? I have ErrorCode = '0x80004005 : e0434352. Thanks! – FunkyPeanut Aug 08 '17 at 11:47
  • @FunkyPeanut I'm afraid I don't know - I didn't find a reference for any of them, just other posts talking about the specific version conflict I had. – Keith Aug 08 '17 at 21:08
  • Unfortunate - thanks for your fast reply! I was able to resolve my issue by manually invoking dotnet on the Azure WebApp using Kudu. I found out a dll was making problems and after decompiling the assembly with ildasm it turned out it got corrupted somehow. So I just manually built and replaced the library and it worked... weird stuff! – FunkyPeanut Aug 08 '17 at 21:14
  • I am trying to get a ASP.NET Core 1.1 Site up and running on a Windows Server 2012 and came through this error. I had to install .NET Core run time 1.1.2 to overcome this error. I don't recall any 1.1.2 references in my project and during testing on local virtual machines installing 1.1.1 runtime was fine. This is where I got 1.1.2 runtime from : https://github.com/dotnet/core/blob/master/release-notes/download-archives/1.1.2-download.md – Francis Aug 22 '17 at 09:05
20

As VS2017 RC is shipped with the new version of .NET Core SDK (.NET Core 1.0.4 SDK 1.0.1), you need to update framework on server as well.

Set
  • 47,577
  • 22
  • 132
  • 150
  • 4
    Actually I've got that issue as well. And this sounds very weird. I've previously had a project built with VS 2015 and setup Core SDK v1.1.1 on the server previously. And now, when migrated to VS 2017 with the new built project had the error and had to install v1.0.4 what's pretty silly. Why does it happen? Not sure I am following what's happening... – Agat Mar 14 '17 at 17:19
20

A possible solution that worked for me is that I added this to my publish profile in Visual Studio:

<PublishWithAspNetCoreTargetManifest>False</PublishWithAspNetCoreTargetManifest>

I believe this will make the host use the required files to run the app instead of relying on specifications set in a target manifest which could be wrong (either the runtime/sdk on server or your local is in conflict with these specifications).

Johan Herstad
  • 672
  • 7
  • 15
  • 1
    This answer should be accepted as a correct one. Doesn't require to update anything on the server side. Thx. – Jack Rus May 11 '18 at 17:49
  • @JackRus maybe, I'll have to test it across a version upgrade first - if it works I'll accept it as the answer. – Keith May 11 '18 at 20:57
  • Thanks, helped me as well. Will be looking for a solution that doesn't depend on my dev environment. – DKMudrechenko Aug 02 '18 at 15:57
  • In the Publish profile configuration I changed the Target Runtime from Portable to win-x64 to resolve this problem. This ends up with an .exe rather than the web.config pointing at the .dll. – Andy G Nov 07 '18 at 15:21
15

I had published a new .NET Core 2.0 web app to Azure App Service and hit this error.

Hitting the site:

HTTP Error 502.5 - Process Failure Common causes of this issue: The application process failed to start The application process started but then stopped The application process started but failed to listen on the configured port

Debugging: Using Azure Application Insights & the App Service - Advanced Tools (KUDU) looking at the Tools - Debug Console - Browsing the LogFiles folder eventlog.xml had a log row:

Application 'MACHINE/WEBROOT/APPHOST/xxxx' with physical root 'D:\home\site\wwwroot\' failed to start process with commandline 'dotnet .\WebApp.dll', ErrorCode = '0x80004005 : 8000808c.

<Provider Name="IIS AspNetCore Module"/>
<EventID>1000</EventID>
<Level>1</Level>
<Task>0</Task>
<EventData>
<Data>Application 'MACHINE/WEBROOT/APPHOST/xxxx' with physical root 'D:\home\site\wwwroot\' failed to start process with commandline 'dotnet .\WebApp.dll', ErrorCode = '0x80004005 : 8000808c.</Data>
</EventData>
</Event>

Solution

This answer: Deleting the wwwroot folder in azure and publish again from VS, worked for me despite not having a legacy Core 1.1 app initially.

Launch Azure Console within the app and delete the contents of the wwwroot folder then redeploy.

RMDIR wwwroot /S /Q

Further testing Following this was very helpful for testing and it works when followed identically, then deviate however you need to find errors. https://learn.microsoft.com/en-us/aspnet/core/tutorials/publish-to-azure-webapp-using-vs

lko
  • 8,161
  • 9
  • 45
  • 62
3

I had this problem as well and thought I'd post my solution. I'm not sure if this is intended or not, but I don't think dotnet core 2 supports Space characters in your Project Name.

I created and published a Project called "Mikes App" and when trying to run the site with IIS I would get this error (.NET Core app unable to start in IIS due to ErrorCode = '0x80004005'). When I enabled stdoutLogs through the web.config file I found the error:

No executable found matching command "dotnet-.\Mikes"

Which I found strange because the web.config file did correctly show the dll path under arguments which was ".\Mikes App.dll"

<aspNetCore processPath="dotnet" arguments=".\Mikes App.dll" stdoutLogEnabled="true" stdoutLogFile=".\logs\stdout" />

I created a new dotnet core 2 project in Visual Studio and named it "Mikes-App" instead, re-published it and updated the directory on my IIS site.

Then the site worked fine!

Mike
  • 93
  • 6
0

I faced the same issue and I only had dotnet cor 2 installed on my server, so by installing this link you are able to run your code in other versions of dot net core. dont forget to restart IIS. https://download.microsoft.com/download/6/A/2/6A21C555-B042-46EA-BBB4-368AACCB3E25/DotNetCore.1.0.8_1.1.5-WindowsHosting.exe

Ehsan Zargar Ershadi
  • 24,115
  • 17
  • 65
  • 95
0

For me I had to make sure I had the latest .Net Core Runtime and Windows Hosting Module installed, all of which are available from https://www.microsoft.com/net/download/windows (newest versions should always be available here).

Specifically, I installed:

The full .Net Framework 4.7.1 runtime might not be needed if you truly do only host .Net Core apps on your server, but I installed it to be safe.

deadlydog
  • 22,611
  • 14
  • 112
  • 118
0

For .net core 2.0

  1. Check the appropriate DotNetCore.2.0.Y-WindowsHosting is installed. If your project is 2.1 then install 2.1. accordingly)
  2. A computer restart is "required" after windows hosting is installed.
  3. Open powershell; cd installation_directory; dotnet abcd.dll This is a pre control you can check after you install WindowsHosting...
0

All I had to do to fix this error was reboot my development computer and recompile & re-publish the site. VS was not responding properly.

Roger D.
  • 1
  • 1
  • OK, I got this error again and this time all I needed to do was to remove the following from the .csproj file: – Roger D. Feb 24 '19 at 05:27
0

I'm running on IIS, and I had error 0x80004005 : 0, which I found in the Event Viewer -> Application Logs. It was being caused because my application pool did not have access to the website folder location.

I resolved it by changing the application pool identity to one with access to the folder.

Jordan Ryder
  • 2,336
  • 1
  • 24
  • 29
0

I've found you have to install the hosting version that is exactly the same as what you have compiled in VS2017. Later versions aren't backwards compatible (at least none I've tried are). So 2.2.8 won't run a 2.2.1 version, for example, even though you would expect a minor revision to do so.

MC9000
  • 2,076
  • 7
  • 45
  • 80
0

If you're getting

Failed to start application '/LM/W3SVC/2/ROOT/{ControllerName}', ErrorCode '0x80004005'. Process Id: 29720. File Version: 16.0.21269.0. Description: IIS ASP.NET Core Module V2.

error when running the app in Visual Studio 2019 or another version.

Solution

You need to close the VS Project and delete .vs hidden folder located in your project folder and restart your VS Project.

You have to Enable Hidden Items option from Windows Explorer so that you can view the hidden .vs folder.

User456
  • 103
  • 6