disable FileWatching for FileVersionProvider/Default IFileProvider
- Dominant language
- C#
- Stars
- 38.4k
- Forks
- 10.9k
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 290
Description
### Is there an existing issue for this?
- [X] I have searched the existing issues
### Is your feature request related to a problem? Please describe the problem.
currently when running production under docker or under kubernetes we sometimes run into:
```
System.IO.IOException: 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.
at System.IO.FileSystemWatcher.StartRaisingEvents()
at Microsoft.Extensions.FileProviders.Physical.PhysicalFilesWatcher.TryEnableFileSystemWatcher()
at Microsoft.Extensions.FileProviders.Physical.PhysicalFilesWatcher.CreateFileChangeToken(String filter)
at Microsoft.AspNetCore.Mvc.Razor.Infrastructure.DefaultFileVersionProvider.AddFileVersionToPath(PathString requestPathBase, String path)
```
the problem is that we use `asp-append-version` which actually triggers a file watcher, since it calls `FileProvider.Watch`.
### Describe the solution you'd like
However in production this is not really that cool, since it can quickly exhaust all inodes. Thus it would be great if it would be possible to disable the file watching in production completly, the same thing that can be done for configuration files via the following: https://docs.microsoft.com/de-de/aspnet/core/fundamentals/host/generic-host?view=aspnetcore-6.0#disable-app-configuration-reload-on-change
### Additional context
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.