Microsoft.Extensions.FileProviders.Physical 9.0.5

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.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.
71
Microsoft.Extensions.Configuration.FileExtensions
Extension methods for configuring file-based configuration providers for Microsoft.Extensions.Configuration.
70
Microsoft.AspNetCore.App
Provides a default set of APIs for building an ASP.NET Core application. This package requires the ASP.NET Core runtime. This runtime is installed by the .NET Core SDK, or can be acquired separately using installers available at https://aka.ms/dotnet-download.
70
Microsoft.Extensions.Configuration.FileExtensions
Extension methods for configuring file-based configuration providers for Microsoft.Extensions.Configuration.
62
Microsoft.AspNetCore.App
Provides a default set of APIs for building an ASP.NET Core application. This package requires the ASP.NET Core runtime. This runtime is installed by the .NET Core SDK, or can be acquired separately using installers available at https://aka.ms/dotnet-download.
62
Microsoft.AspNetCore.App
Provides a default set of APIs for building an ASP.NET Core application. This package requires the ASP.NET Core runtime. This runtime is installed by the .NET Core SDK, or can be acquired separately using installers available at https://aka.ms/dotnet-download.
58
Microsoft.VisualStudio.Web.CodeGeneration.Tools
Code Generation tool for ASP.NET Core. Contains the dotnet-aspnet-codegenerator command used for generating controllers and views.
56
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
56
Microsoft.Extensions.Hosting
.NET Core hosting and startup infrastructures for applications.
55
Microsoft.AspNetCore.SpaServices.Extensions
Helpers for building single-page applications on ASP.NET MVC Core. This package was built from the source code at https://github.com/dotnet/aspnetcore/tree/55738ff96b832439076e25584cfe0eb3bace9b01
55
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
54
Microsoft.AspNetCore.App
Microsoft.AspNetCore.App
51
Microsoft.Extensions.Configuration.FileExtensions
Extension methods for configuring file-based configuration providers for Microsoft.Extensions.Configuration.
50
Microsoft.Extensions.Configuration.FileExtensions
Extension methods for configuring file-based configuration providers for Microsoft.Extensions.Configuration.
49
Microsoft.AspNetCore.App
Provides a default set of APIs for building an ASP.NET Core application. This package requires the ASP.NET Core runtime. This runtime is installed by the .NET Core SDK, or can be acquired separately using installers available at https://aka.ms/dotnet-download.
49
Microsoft.VisualStudio.Web.CodeGeneration.Tools
Code Generation tool for ASP.NET Core. Contains the dotnet-aspnet-codegenerator command used for generating controllers and views.
47
Microsoft.Extensions.Hosting
.NET Core hosting and startup infrastructures for applications.
47
Microsoft.VisualStudio.Web.CodeGeneration.Tools
Code Generation tool for ASP.NET Core. Contains the dotnet-aspnet-codegenerator command used for generating controllers and views.
46

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

Version Downloads Last updated
10.0.0-preview.5.25277.114 0 06/06/2025
10.0.0-preview.4.25258.110 6 05/20/2025
10.0.0-preview.3.25171.5 10 04/17/2025
10.0.0-preview.2.25163.2 12 03/19/2025
10.0.0-preview.1.25080.5 13 03/07/2025
9.0.5 3 05/19/2025
9.0.4 9 04/10/2025
9.0.3 9 03/14/2025
9.0.2 15 02/17/2025
9.0.1 13 01/19/2025
9.0.0 18 11/13/2024
9.0.0-rc.2.24473.5 19 10/11/2024
9.0.0-rc.1.24431.7 15 09/17/2024
9.0.0-preview.7.24405.7 20 08/15/2024
9.0.0-preview.6.24327.7 15 07/11/2024
9.0.0-preview.5.24306.7 14 06/13/2024
9.0.0-preview.4.24266.19 19 05/23/2024
9.0.0-preview.3.24172.9 18 04/18/2024
9.0.0-preview.2.24128.5 17 03/15/2024
9.0.0-preview.1.24080.9 15 06/13/2024
8.0.0 20 12/21/2023
8.0.0-rc.2.23479.6 18 12/21/2023
8.0.0-rc.1.23419.4 16 12/21/2023
8.0.0-preview.7.23375.6 12 06/28/2024
8.0.0-preview.6.23329.7 16 12/21/2023
8.0.0-preview.5.23280.8 17 12/21/2023
8.0.0-preview.4.23259.5 40 08/22/2023
8.0.0-preview.3.23174.8 19 08/27/2023
8.0.0-preview.2.23128.3 57 04/29/2023
8.0.0-preview.1.23110.8 19 08/25/2023
7.0.0 39 04/24/2023
7.0.0-rc.2.22472.3 22 08/23/2023
7.0.0-rc.1.22426.10 16 08/25/2023
7.0.0-preview.7.22375.6 19 08/24/2023
7.0.0-preview.6.22324.4 21 08/23/2023
7.0.0-preview.5.22301.12 32 08/25/2023
7.0.0-preview.4.22229.4 20 08/22/2023
7.0.0-preview.3.22175.4 19 08/21/2023
7.0.0-preview.2.22152.2 27 08/27/2023
7.0.0-preview.1.22076.8 19 08/26/2023
6.0.2-mauipre.1.22102.15 16 08/24/2023
6.0.2-mauipre.1.22054.8 18 06/28/2024
6.0.1 16 11/13/2024
6.0.0 41 11/17/2021
6.0.0-rc.2.21480.5 17 08/23/2023
6.0.0-rc.1.21451.13 15 08/23/2023
6.0.0-preview.7.21377.19 18 08/21/2023
6.0.0-preview.6.21352.12 30 08/23/2023
6.0.0-preview.5.21301.5 22 08/26/2023
6.0.0-preview.4.21253.7 19 08/23/2023
6.0.0-preview.3.21201.4 21 08/21/2023
6.0.0-preview.2.21154.6 17 08/24/2023
6.0.0-preview.1.21102.12 16 08/25/2023
5.0.0 81 01/13/2021
5.0.0-rc.2.20475.5 19 08/27/2023
5.0.0-rc.1.20451.14 20 08/22/2023
5.0.0-preview.8.20407.11 20 08/25/2023
5.0.0-preview.7.20364.11 19 12/07/2023
5.0.0-preview.6.20305.6 22 08/24/2023
5.0.0-preview.5.20278.1 18 08/22/2023
5.0.0-preview.4.20251.6 20 08/25/2023
5.0.0-preview.3.20215.2 24 08/21/2023
5.0.0-preview.2.20160.3 18 08/25/2023
5.0.0-preview.1.20120.4 22 08/23/2023
3.1.32 30 06/11/2023
3.1.31 35 06/11/2023
3.1.30 48 12/13/2022
3.1.29 20 06/11/2023
3.1.28 19 06/11/2023
3.1.27 24 06/12/2023
3.1.26 18 06/12/2023
3.1.25 21 06/11/2023
3.1.24 21 06/11/2023
3.1.23 14 06/11/2023
3.1.22 18 06/11/2023
3.1.21 19 06/11/2023
3.1.20 20 06/13/2023
3.1.19 20 06/11/2023
3.1.18 22 06/11/2023
3.1.17 21 06/12/2023
3.1.16 21 06/12/2023
3.1.15 24 06/11/2023
3.1.14 23 06/11/2023
3.1.13 33 06/11/2023
3.1.12 19 06/10/2023
3.1.11 20 06/12/2023
3.1.10 31 01/17/2021
3.1.9 16 06/10/2023
3.1.8 21 06/10/2023
3.1.7 33 06/10/2023
3.1.6 17 06/09/2023
3.1.5 50 06/13/2020
3.1.4 22 06/10/2023
3.1.3 25 06/10/2023
3.1.2 19 04/04/2021
3.1.1 21 07/08/2021
3.1.0 21 03/20/2023
3.1.0-preview3.19553.2 18 08/27/2023
3.1.0-preview2.19525.4 17 08/21/2023
3.1.0-preview1.19506.1 18 08/26/2023
3.0.3 21 06/09/2023
3.0.2 29 06/09/2023
3.0.1 20 06/11/2023
3.0.0 40 06/10/2023
3.0.0-rc1.19456.10 16 08/21/2023
3.0.0-preview9.19423.4 19 08/25/2023
3.0.0-preview8.19405.4 21 08/27/2023
3.0.0-preview7.19362.4 15 08/26/2023
3.0.0-preview6.19304.6 22 08/27/2023
3.0.0-preview5.19227.9 18 08/21/2023
3.0.0-preview4.19216.2 16 08/24/2023
3.0.0-preview3.19153.1 19 08/23/2023
3.0.0-preview.19074.2 20 08/23/2023
3.0.0-preview.18572.1 17 08/23/2023
2.2.0 61 06/13/2020
2.2.0-preview3-35497 22 08/24/2023
2.2.0-preview2-35157 23 08/21/2023
2.2.0-preview1-35029 21 08/23/2023
2.1.1 63 12/30/2020
2.1.0 22 06/10/2023
2.1.0-rc1-final 22 06/10/2023
2.1.0-preview2-final 21 06/10/2023
2.1.0-preview1-final 24 06/10/2023
2.0.1 20 11/29/2019
2.0.0 21 12/27/2019
2.0.0-preview2-final 18 06/11/2023
2.0.0-preview1-final 20 06/09/2023
1.1.1 24 11/25/2019
1.1.0 19 06/09/2023
1.1.0-preview1-final 21 06/09/2023
1.0.1 31 11/25/2019
1.0.0 19 05/21/2020
1.0.0-rc2-final 23 06/09/2023