Skip to content

Add a note about generic host default behaviour when using launchd with default cwd #36798

@rosebyte

Description

@rosebyte

Please see dotnet/runtime#121256

There isn't much we can do in terms of code changes as any change would break a lot of users, however, we can help users understand the situation when they run a generic host based app using launchd without setting the WorkingDirectory in the plist, so they won't have to debug on their own as this situation is difficult to work out in general.

I propose to add these two columns to the very end of the file settings configuration section (https://learn.microsoft.com/en-us/aspnet/core/fundamentals/configuration/?view=aspnetcore-9.0#app-settings-file-configuration-appsettingsjson-appsettingsenvironmentjson)

Service managers such as SCM, launchd, or systemd may, if not configured correctly, set the application’s working directory to a location outside the directory that contains the configuration files, commonly the root directory on Unix systems or a drive root such as C:/ on Windows. In this case, the file system watcher may end up monitoring a large portion of the filesystem.

This can lead to unintended side effects, including permission errors when accessing files outside the application directory and unnecessary performance overhead due to the number of files being observed. To avoid these issues, it is recommended to configure the hosting environment or service manager to set an appropriate working directory for the application.

Metadata

Metadata

Assignees

Labels

ai-triage-action-planAssigned when an AI generated triage and action plan report is created for an issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions