From 6a2e668e670c937aa570a92875d0054ff5adf32a Mon Sep 17 00:00:00 2001 From: Yusuf Baylav <330015149+baylavdev@users.noreply.github.com> Date: Fri, 18 Sep 2026 16:57:47 +0300 Subject: [PATCH 1/3] docs: add Linux inotify limits guidance to dotnet watch Added a new section explaining how to resolve the common inotify instance limit error on Linux and Docker by increasing fs.inotify.max_user_instances and max_user_watches via sysctl. Fixes #19814 Signed-off-by: Yusuf Baylav <330015149+baylavdev@users.noreply.github.com> --- aspnetcore/tutorials/dotnet-watch.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/aspnetcore/tutorials/dotnet-watch.md b/aspnetcore/tutorials/dotnet-watch.md index 1a859526cf84..e7343236a93c 100644 --- a/aspnetcore/tutorials/dotnet-watch.md +++ b/aspnetcore/tutorials/dotnet-watch.md @@ -227,3 +227,29 @@ Visual Studio 17.2 or later includes the .NET SDK 6.0.300 or later. With the .NE * Configure the `DOTNET_WATCH_SUPPRESS_EMOJIS=1` environment variable to suppress emitting these values. * Switch to a different terminal, such as https://github.com/microsoft/terminal, that supports rendering non-ASCII characters. + + +## File watcher limits in Linux + +When running `dotnet watch` on Linux or in Docker containers, you may encounter an error indicating that the configured user limit on the number of inotify instances has been reached: + +`The configured user limit (128) on the number of inotify instances has been reached, or the per-process limit on the number of open file descriptors has been reached.` + +This happens because the operating system limits the number of file watchers that a single user can create. To resolve this issue, increase the `fs.inotify.max_user_instances` and `fs.inotify.max_user_watches` system limits. + +To temporarily increase these limits, run the following commands: + +```console +sudo sysctl fs.inotify.max_user_instances=524288 +sudo sysctl fs.inotify.max_user_watches=524288 +``` + +To make this change permanent, add the following lines to the `/etc/sysctl.conf` file: + +```ini +fs.inotify.max_user_instances=524288 +fs.inotify.max_user_watches=524288 +``` + +> [!NOTE] +> For Docker containers, these limits are inherited from the host operating system. You must configure the `sysctl` settings on the host machine, rather than inside the container. From f97e3103d7c1e729c248c9eb6cdb6cdd37b16a8c Mon Sep 17 00:00:00 2001 From: Luke Latham <1622880+guardrex@users.noreply.github.com> Date: Wed, 23 Sep 2026 07:48:54 -0400 Subject: [PATCH 2/3] Update inotify limit resolution instructions Clarified instructions for increasing inotify limits. Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- aspnetcore/tutorials/dotnet-watch.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aspnetcore/tutorials/dotnet-watch.md b/aspnetcore/tutorials/dotnet-watch.md index e7343236a93c..5582a360b39c 100644 --- a/aspnetcore/tutorials/dotnet-watch.md +++ b/aspnetcore/tutorials/dotnet-watch.md @@ -235,7 +235,7 @@ When running `dotnet watch` on Linux or in Docker containers, you may encounter `The configured user limit (128) on the number of inotify instances has been reached, or the per-process limit on the number of open file descriptors has been reached.` -This happens because the operating system limits the number of file watchers that a single user can create. To resolve this issue, increase the `fs.inotify.max_user_instances` and `fs.inotify.max_user_watches` system limits. +If the inotify instance limit is exhausted, increase `fs.inotify.max_user_instances`. If the process has reached its open-file-descriptor limit, increase that limit instead. The separate `fs.inotify.max_user_watches` setting applies when the inotify watch limit is exhausted. To temporarily increase these limits, run the following commands: From 91b4a97cbf3665493e5bbfd1d9dfd6ccbe67ae95 Mon Sep 17 00:00:00 2001 From: Luke Latham <1622880+guardrex@users.noreply.github.com> Date: Wed, 23 Sep 2026 07:50:36 -0400 Subject: [PATCH 3/3] Apply suggestion from @guardrex --- aspnetcore/tutorials/dotnet-watch.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aspnetcore/tutorials/dotnet-watch.md b/aspnetcore/tutorials/dotnet-watch.md index 5582a360b39c..1e9c35ff005b 100644 --- a/aspnetcore/tutorials/dotnet-watch.md +++ b/aspnetcore/tutorials/dotnet-watch.md @@ -3,7 +3,7 @@ title: Develop ASP.NET Core apps using a file watcher author: tdykstra description: This tutorial demonstrates how to install and use the .NET CLI's file watcher (dotnet watch) tool in an ASP.NET Core app. ms.author: tdykstra -ms.date: 05/31/2018 +ms.date: 09/23/2026 uid: tutorials/dotnet-watch --- # Develop ASP.NET Core apps using a file watcher