DEV Community

Sven Glöckner
Sven Glöckner

Posted on

1

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" 😏

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay