Microsoft.Extensions.FileProviders.Physical 10.0.0-preview.1.25080.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.AspNetCore.All
Provides a default set of APIs for building an ASP.NET Core application, and also includes API for third-party integrations with ASP.NET Core. 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.
56
Microsoft.AspNetCore.All
Provides a default set of APIs for building an ASP.NET Core application, and also includes API for third-party integrations with ASP.NET Core. 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.
55
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.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.
78
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. This package was built from the source at: https://github.com/aspnet/Universe/tree/1016eae4004686f7fdad13f5c329f63bbae1f3a1
67
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
63
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 at: https://github.com/aspnet/Diagnostics/tree/983d7836ab27bce47a86e5425860e8ac1ff2b858
65
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
81
Microsoft.AspNetCore.Mvc.Razor.Host
ASP.NET Core MVC design time hosting infrastructure for the Razor view engine.
60
Microsoft.AspNetCore.Mvc.Razor.Host
ASP.NET Core MVC design time hosting infrastructure for the Razor view engine.
83
Microsoft.Extensions.Configuration.FileExtensions
Extension methods for configuring file-based configuration providers for Microsoft.Extensions.Configuration.
64
Microsoft.Extensions.Configuration.FileExtensions
Extension methods for configuring file-based configuration providers for Microsoft.Extensions.Configuration.
65
Microsoft.Extensions.Configuration.FileExtensions
Extension methods for configuring file-based configuration providers for Microsoft.Extensions.Configuration.
73
Microsoft.Extensions.Configuration.FileExtensions
Extension methods for configuring file-based configuration providers for Microsoft.Extensions.Configuration.
2,067
Microsoft.Extensions.Configuration.FileExtensions
Extension methods for configuring file-based configuration providers for Microsoft.Extensions.Configuration.
10,301
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.
1,878
Microsoft.Extensions.Configuration.UserSecrets
User secrets configuration provider implementation for Microsoft.Extensions.Configuration.
58
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.
67

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

.NET Framework 4.6.2

.NET Standard 2.0

.NET 10.0

.NET 9.0

.NET 8.0

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