Microsoft.Extensions.FileProviders.Physical 10.0.1

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.Hosting
ASP.NET Core hosting infrastructure and startup logic for web applications.
90
Microsoft.AspNetCore.Hosting
ASP.NET Core hosting infrastructure and startup logic for web applications.
1,032
Microsoft.AspNetCore.Mvc.Razor.Host
ASP.NET Core MVC design time hosting infrastructure for the Razor view engine.
131
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/aspnet/AspNetCore/tree/2b7e994b8a304700a09617ffc5052f0d943bbcba
283
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/aspnet/AspNetCore/tree/7b22a279ec975335bbb0a7cbadef2e45ee15aa9c
87
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/32e8c8cae5b1a4dd752d0a42a6f8a2813f75f173
88
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/371a26f07b23ad77c636332c2dfc0cbd1d8137ba
57
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/b7a2ec8c7ed6b48857af0a69688a73e8c14fe6cb
90
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/b92c9f50f0333ea661785ba849f303cde6a93844
201
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/c911002ab43b7b989ed67090f2a48d9073d5118d
960
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/fc93e595ceffbb1e3e85532bf454e92a6a80dd6b
65
Microsoft.Extensions.Configuration.FileExtensions
Extension methods for configuring file-based configuration providers for Microsoft.Extensions.Configuration.
78
Microsoft.Extensions.Configuration.FileExtensions
Extension methods for configuring file-based configuration providers for Microsoft.Extensions.Configuration.
93
Microsoft.Extensions.Configuration.FileExtensions
Extension methods for configuring file-based configuration providers for Microsoft.Extensions.Configuration.
97
Microsoft.Extensions.Configuration.FileExtensions
Extension methods for configuring file-based configuration providers for Microsoft.Extensions.Configuration.
390
Microsoft.Extensions.Configuration.FileExtensions
Extension methods for configuring file-based configuration providers for Microsoft.Extensions.Configuration.
2,812
Microsoft.Extensions.Configuration.FileExtensions
Extension methods for configuring file-based configuration providers for Microsoft.Extensions.Configuration.
2,875
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
341
Microsoft.Extensions.Hosting
.NET Core hosting and startup infrastructures for applications.
60
Microsoft.Extensions.Hosting
Hosting and startup infrastructures for applications.
58

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

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