DEV Community

Sven Glöckner
Sven Glöckner

Posted on

ASP.NET Core: Invalid log file path leads to startup failure on Azure App Service

I've been using the default web.config with the setting stdoutLogFile=".\LogFiles\stdout" for a while now.
Yesterday, I created new App Service Slot as Staging environment.
My build and release pipeline in Azure DevOps was running fine, but after deployment the App didn't start and I had several errors in the Application Event Logs, for instance:

Could not find 'aspnetcorev2_inprocess.dll'. Exception message:
Invalid runtimeconfig.json [D:\home\site\wwwroot\MyApp.runtimeconfig.json] [D:\home\site\wwwroot\MyApp.runtimeconfig.dev.json]

I searched the web and found this issue on GitHub.
It's already closed so we cannot add additional feedback there.

I've tried the solution there and I was really amazed that afterwards my App Service is running fine.

TL;DR
Change the stdoutLogFile setting to: stdoutLogFile="\\?\%home%\LogFiles\stdout" 😏

Top comments (0)