Microsoft.Extensions.FileProviders.Physical 9.0.22

About

Provides an implementation of a physical file provider, facilitating file access and monitoring on the disk. The primary type, PhysicalFileProvider, enables the lookup of files on disk and can watch for changes either via FileSystemWatcher or polling mechanisms.

Key Features

  • Easy access and monitoring of files on the disk.
  • Ability to watch for file changes either by using FileSystemWatcher or through polling.

How to Use

This library can be used to look up files on disk and monitor file changes effectively. Below is an example of how to use the PhysicalFileProvider to access files on disk and monitor changes:

using Microsoft.Extensions.FileProviders;
using Microsoft.Extensions.FileProviders.Physical;

using var provider = new PhysicalFileProvider(AppContext.BaseDirectory);

Environment.SetEnvironmentVariable("DOTNET_USE_POLLING_FILE_WATCHER", "1");

var contents = provider.GetDirectoryContents(string.Empty);
foreach (PhysicalFileInfo fileInfo in contents)
{
    Console.WriteLine(fileInfo.PhysicalPath);
}

var changeToken = provider.Watch("*.txt");
changeToken.RegisterChangeCallback(_ => Console.WriteLine("Text file changed"), null);

Console.ReadLine();

Main Types

The main types provided by this library are:

  • Microsoft.Extensions.FileProviders.PhysicalFileProvider
  • Microsoft.Extensions.FileProviders.PhysicalDirectoryInfo
  • Microsoft.Extensions.FileProviders.PhysicalFileInfo

Additional Documentation

Feedback & Contributing

Microsoft.Extensions.FileProviders.Physical is released as open source under the MIT license. Bug reports and contributions are welcome at the GitHub repository.

Showing the top 20 packages that depend on Microsoft.Extensions.FileProviders.Physical.

Packages Downloads
Microsoft.AspNetCore.All
Microsoft.AspNetCore.All
39
Microsoft.AspNetCore.Diagnostics
ASP.NET Core middleware for exception handling, exception display pages, and diagnostics information. Includes developer exception page middleware, exception handler middleware, runtime info middleware, status code page middleware, and welcome page middleware
39
Microsoft.AspNetCore.Diagnostics
ASP.NET Core middleware for exception handling, exception display pages, and diagnostics information. Includes developer exception page middleware, exception handler middleware, runtime info middleware, status code page middleware, and welcome page middleware This package was built from the source code at https://github.com/aspnet/Diagnostics/tree/c802d5ef5fba1ba8dfbcb8c3741af2ba15e9d1aa
686
Microsoft.AspNetCore.Hosting
ASP.NET Core hosting infrastructure and startup logic for web applications.
39
Microsoft.AspNetCore.Hosting
ASP.NET Core hosting infrastructure and startup logic for web applications.
660
Microsoft.AspNetCore.Hosting
ASP.NET Core hosting infrastructure and startup logic for web applications. This package was built from the source code at https://github.com/aspnet/Hosting/tree/0724e6cde1149ee1a19bfec9c13a2c9327b71213
683
Microsoft.Extensions.Configuration.FileExtensions
Extension methods for configuring file-based configuration providers for Microsoft.Extensions.Configuration.
38
Microsoft.Extensions.Configuration.FileExtensions
Extension methods for configuring file-based configuration providers for Microsoft.Extensions.Configuration.
168
Microsoft.Extensions.Configuration.FileExtensions
Extension methods for configuring file-based configuration providers for Microsoft.Extensions.Configuration. When using NuGet 3.x this package requires at least version 3.4.
42
Microsoft.Extensions.Configuration.FileExtensions
Extension methods for configuring file-based configuration providers for Microsoft.Extensions.Configuration. This package was built from the source code at https://github.com/aspnet/Extensions/tree/9bc79b2f25a3724376d7af19617c33749a30ea3a
755
Microsoft.Extensions.Configuration.FileExtensions
Extension methods for configuring file-based configuration providers for Microsoft.Extensions.Configuration. This package was built from the source at: https://github.com/aspnet/Configuration/tree/231faba8507764812c5038423a114eaee65705cb
39
Microsoft.Extensions.Configuration.FileExtensions
Provides a base class for file-based configuration providers used with Microsoft.Extensions.Configuration and extension methods for configuring them.
52
Microsoft.Extensions.Configuration.UserSecrets
User secrets configuration provider implementation for Microsoft.Extensions.Configuration.
163
Microsoft.Extensions.Configuration.UserSecrets
User secrets configuration provider implementation for Microsoft.Extensions.Configuration. When using NuGet 3.x this package requires at least version 3.4.
47
Microsoft.Extensions.Hosting
.NET Core hosting and startup infrastructures for applications.
41
Microsoft.Extensions.Hosting
Hosting and startup infrastructures for applications.
44
Microsoft.Extensions.Hosting
Hosting and startup infrastructures for applications.
66
Microsoft.Extensions.Hosting
Hosting and startup infrastructures for applications.
182

https://go.microsoft.com/fwlink/?LinkID=799421

Version Downloads Last updated
11.0.0-rc.3.26522.148 1 10/27/2026
11.0.0-rc.2.26504.105 6 10/18/2026
11.0.0-rc.1.26425.128 6 09/21/2026
11.0.0-preview.7.26381.103 2 08/15/2026
11.0.0-preview.6.26359.118 7 07/26/2026
11.0.0-preview.5.26302.115 7 06/15/2026
11.0.0-preview.4.26230.115 5 05/26/2026
11.0.0-preview.3.26207.106 4 04/15/2026
11.0.0-preview.2.26159.112 13 03/11/2026
11.0.0-preview.1.26104.118 16 02/12/2026
10.0.14 1 10/27/2026
10.0.13 6 10/17/2026
10.0.12 5 09/24/2026
10.0.11 2 08/15/2026
10.0.10 4 07/24/2026
10.0.9 3 06/15/2026
10.0.8 7 05/22/2026
10.0.7 14 05/06/2026
10.0.6 9 04/16/2026
10.0.5 6 03/14/2026
10.0.4 15 03/11/2026
10.0.3 13 02/12/2026
10.0.2 21 01/16/2026
10.0.1 17 12/11/2025
10.0.0 20 11/14/2025
10.0.0-rc.2.25502.107 17 10/16/2025
10.0.0-rc.1.25451.107 23 09/11/2025
10.0.0-preview.7.25380.108 28 08/15/2025
10.0.0-preview.6.25358.103 23 07/17/2025
10.0.0-preview.5.25277.114 24 06/08/2025
10.0.0-preview.4.25258.110 21 05/16/2025
10.0.0-preview.3.25171.5 16 04/28/2025
10.0.0-preview.2.25163.2 23 03/20/2025
10.0.0-preview.1.25080.5 22 03/05/2025
9.0.22 1 10/27/2026
9.0.21 6 10/17/2026
9.0.20 3 09/24/2026
9.0.19 2 08/15/2026
9.0.18 3 07/21/2026
9.0.17 8 06/15/2026
9.0.16 11 05/22/2026
9.0.15 8 04/16/2026
9.0.14 14 03/11/2026
9.0.13 9 02/12/2026
9.0.12 11 01/17/2026
9.0.11 21 11/14/2025
9.0.10 14 10/16/2025
9.0.9 18 09/11/2025
9.0.8 23 08/07/2025
9.0.7 18 07/17/2025
9.0.6 23 06/14/2025
9.0.5 26 05/16/2025
9.0.4 22 04/28/2025
9.0.3 35 03/20/2025
9.0.2 20 02/20/2025
9.0.1 28 01/18/2025
9.0.0 23 01/18/2025
9.0.0-rc.2.24473.5 21 01/18/2025
9.0.0-rc.1.24431.7 21 01/18/2025
9.0.0-preview.7.24405.7 27 01/18/2025
9.0.0-preview.6.24327.7 19 01/18/2025
9.0.0-preview.5.24306.7 25 01/18/2025
9.0.0-preview.4.24266.19 19 01/18/2025
9.0.0-preview.3.24172.9 18 01/18/2025
9.0.0-preview.2.24128.5 19 03/25/2024
9.0.0-preview.1.24080.9 24 02/15/2024
8.0.0 55 11/15/2023
8.0.0-rc.2.23479.6 32 10/30/2023
8.0.0-rc.1.23419.4 25 03/16/2024
8.0.0-preview.7.23375.6 21 03/09/2024
8.0.0-preview.6.23329.7 25 03/09/2024
8.0.0-preview.5.23280.8 25 03/14/2024
8.0.0-preview.4.23259.5 27 03/09/2024
8.0.0-preview.3.23174.8 26 03/08/2024
8.0.0-preview.2.23128.3 29 01/18/2025
8.0.0-preview.1.23110.8 28 03/02/2024
7.0.0 171 08/18/2023
7.0.0-rc.2.22472.3 22 03/22/2024
7.0.0-rc.1.22426.10 32 03/08/2024
7.0.0-preview.7.22375.6 26 03/08/2024
7.0.0-preview.6.22324.4 23 03/08/2024
7.0.0-preview.5.22301.12 28 03/09/2024
7.0.0-preview.4.22229.4 22 03/08/2024
7.0.0-preview.3.22175.4 29 11/04/2023
7.0.0-preview.2.22152.2 24 01/18/2025
7.0.0-preview.1.22076.8 26 03/08/2024
6.0.2-mauipre.1.22102.15 25 03/18/2024
6.0.2-mauipre.1.22054.8 26 03/18/2024
6.0.1 27 01/18/2025
6.0.0 43 08/18/2023
6.0.0-rc.2.21480.5 26 01/18/2025
6.0.0-rc.1.21451.13 29 03/15/2024
6.0.0-preview.7.21377.19 32 03/02/2024
6.0.0-preview.6.21352.12 19 03/09/2024
6.0.0-preview.5.21301.5 28 03/10/2024
6.0.0-preview.4.21253.7 25 03/02/2024
6.0.0-preview.3.21201.4 25 03/02/2024
6.0.0-preview.2.21154.6 22 01/18/2025
6.0.0-preview.1.21102.12 25 03/08/2024
5.0.0 38 08/18/2023
5.0.0-rc.2.20475.5 25 03/17/2024
5.0.0-rc.1.20451.14 19 03/17/2024
5.0.0-preview.8.20407.11 22 11/04/2023
5.0.0-preview.7.20364.11 26 03/11/2024
5.0.0-preview.6.20305.6 23 03/02/2024
5.0.0-preview.5.20278.1 26 03/11/2024
5.0.0-preview.4.20251.6 26 03/10/2024
5.0.0-preview.3.20215.2 26 03/09/2024
5.0.0-preview.2.20160.3 26 03/10/2024
5.0.0-preview.1.20120.4 31 03/09/2024
3.1.32 25 03/07/2024
3.1.31 26 03/16/2024
3.1.30 21 03/17/2024
3.1.29 21 03/15/2024
3.1.28 29 03/16/2024
3.1.27 28 03/15/2024
3.1.26 25 03/16/2024
3.1.25 27 03/15/2024
3.1.24 25 03/15/2024
3.1.23 31 03/07/2024
3.1.22 26 03/16/2024
3.1.21 20 01/18/2025
3.1.20 24 03/16/2024
3.1.19 24 03/15/2024
3.1.18 22 11/03/2023
3.1.17 24 03/08/2024
3.1.16 28 03/15/2024
3.1.15 24 03/15/2024
3.1.14 28 03/06/2024
3.1.13 29 03/07/2024
3.1.12 24 03/15/2024
3.1.11 22 03/15/2024
3.1.10 21 03/22/2024
3.1.9 31 03/07/2024
3.1.8 30 03/18/2024
3.1.7 27 03/15/2024
3.1.6 38 11/02/2023
3.1.5 30 03/15/2024
3.1.4 38 11/04/2023
3.1.3 30 03/07/2024
3.1.2 28 03/15/2024
3.1.1 30 03/25/2024
3.1.0 27 11/15/2023
3.1.0-preview3.19553.2 24 03/15/2024
3.1.0-preview2.19525.4 24 01/18/2025
3.1.0-preview1.19506.1 23 11/03/2023
3.0.3 22 03/15/2024
3.0.2 29 03/08/2024
3.0.1 32 03/07/2024
3.0.0 23 03/19/2024
3.0.0-rc1.19456.10 18 03/16/2024
3.0.0-preview9.19423.4 21 11/02/2023
3.0.0-preview8.19405.4 33 03/10/2024
3.0.0-preview7.19362.4 30 03/09/2024
3.0.0-preview6.19304.6 27 01/18/2025
3.0.0-preview5.19227.9 22 03/10/2024
3.0.0-preview4.19216.2 23 03/09/2024
3.0.0-preview3.19153.1 22 11/03/2023
3.0.0-preview.19074.2 26 03/10/2024
3.0.0-preview.18572.1 33 01/18/2025
2.2.0 766 08/18/2023
2.2.0-preview3-35497 23 03/16/2024
2.2.0-preview2-35157 27 03/16/2024
2.2.0-preview1-35029 27 03/08/2024
2.1.1 28 03/15/2024
2.1.0 25 03/06/2024
2.1.0-rc1-final 22 03/15/2024
2.1.0-preview2-final 22 03/02/2024
2.1.0-preview1-final 30 03/15/2024
2.0.1 26 03/15/2024
2.0.0 33 03/07/2024
2.0.0-preview2-final 29 03/07/2024
2.0.0-preview1-final 31 03/15/2024
1.1.1 25 03/18/2024
1.1.0 635 08/18/2023
1.1.0-preview1-final 22 03/15/2024
1.0.1 26 03/15/2024
1.0.0 22 03/16/2024
1.0.0-rc2-final 23 03/17/2024