Microsoft.Extensions.FileProviders.Physical 10.0.0-preview.6.25358.103

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.VisualStudio.Web.BrowserLink
A middleware that supports creating a communication channel between the development environment and one or more web browsers. This package was built from the source code at https://github.com/aspnet/BrowserLink/tree/8cd3e0844d74975060a2bb1abb1e0a5ff943ce45
36
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
35
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/2924ca229b3d6c91b7c9eded119b31dfd7aa1fef
35
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/0a2e366eaf4d29b24b9a98e5782a04bef573189e
35
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/AspNetCore/tree/be0a4a7f4cf06cbd6ec714bd1d9afee6bdb040a8
34
Microsoft.AspNetCore.Mvc.Razor.Host
ASP.NET Core MVC design time hosting infrastructure for the Razor view engine.
34
Microsoft.Extensions.Hosting
.NET Core hosting and startup infrastructures for applications.
34
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
34
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/02c6de4ba6022025fcda7581415f310f8c73cdc3
34
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/6939d9ab90aa1e57bb0619bb28819f7bcbfdbb54
34
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/2e51a0b6eba74bdf02aee71944e973487937cb99
34
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/417d650029c720dbd2138bcafbb78e2e4ff31bff
34
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
33
Microsoft.Extensions.Configuration.FileExtensions
Extension methods for configuring file-based configuration providers for Microsoft.Extensions.Configuration.
33
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/e276c8174b8bfdeb70efceafa81c75f8badbc8db
33
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/aee5e4080331553ea9dfb7fb388b6d72f715bf6a
33
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/67acc3d331454956fc06d6de2218a625e3e596f8
33
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/be51b1aa73343e45a1d00afd436abad794f471fb
33
Microsoft.Extensions.Configuration.KeyPerFile
Configuration provider that uses files in a directory for Microsoft.Extensions.Configuration. This package was built from the source code at https://github.com/dotnet/aspnetcore/tree/be51b1aa73343e45a1d00afd436abad794f471fb
33

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.6.25358.103 3 7/17/2025
10.0.0-preview.5.25277.114 7 6/8/2025
10.0.0-preview.4.25258.110 11 5/16/2025
10.0.0-preview.3.25171.5 17 4/24/2025
10.0.0-preview.2.25163.2 15 3/25/2025
10.0.0-preview.1.25080.5 18 3/1/2025
9.0.8 1 8/7/2025
9.0.7 2 7/11/2025
9.0.6 5 6/12/2025
9.0.5 9 5/16/2025
9.0.4 15 4/25/2025
9.0.3 14 3/12/2025
9.0.2 17 2/19/2025
9.0.1 19 2/18/2025
9.0.0 21 12/4/2024
9.0.0-rc.2.24473.5 22 11/26/2024
9.0.0-rc.1.24431.7 19 9/10/2024
9.0.0-preview.7.24405.7 19 8/13/2024
9.0.0-preview.6.24327.7 22 7/18/2024
9.0.0-preview.5.24306.7 22 8/8/2024
9.0.0-preview.4.24266.19 19 8/13/2024
9.0.0-preview.3.24172.9 25 4/15/2024
9.0.0-preview.2.24128.5 23 4/24/2024
9.0.0-preview.1.24080.9 23 3/9/2024
8.0.0 33 3/2/2024
8.0.0-rc.2.23479.6 23 3/9/2024
8.0.0-rc.1.23419.4 23 3/9/2024
8.0.0-preview.7.23375.6 24 3/9/2024
8.0.0-preview.6.23329.7 24 3/9/2024
8.0.0-preview.5.23280.8 24 3/9/2024
8.0.0-preview.4.23259.5 21 3/9/2024
8.0.0-preview.3.23174.8 25 3/9/2024
8.0.0-preview.2.23128.3 24 2/27/2024
8.0.0-preview.1.23110.8 24 3/9/2024
7.0.0 32 3/9/2024
7.0.0-rc.2.22472.3 25 3/9/2024
7.0.0-rc.1.22426.10 23 3/9/2024
7.0.0-preview.7.22375.6 27 3/9/2024
7.0.0-preview.6.22324.4 23 3/9/2024
7.0.0-preview.5.22301.12 22 3/9/2024
7.0.0-preview.4.22229.4 25 3/9/2024
7.0.0-preview.3.22175.4 23 3/9/2024
7.0.0-preview.2.22152.2 25 3/9/2024
7.0.0-preview.1.22076.8 23 3/9/2024
6.0.2-mauipre.1.22102.15 26 3/9/2024
6.0.2-mauipre.1.22054.8 23 3/9/2024
6.0.1 18 12/4/2024
6.0.0 25 3/9/2024
6.0.0-rc.2.21480.5 24 3/9/2024
6.0.0-rc.1.21451.13 23 3/9/2024
6.0.0-preview.7.21377.19 26 3/9/2024
6.0.0-preview.6.21352.12 27 3/9/2024
6.0.0-preview.5.21301.5 26 3/9/2024
6.0.0-preview.4.21253.7 23 3/9/2024
6.0.0-preview.3.21201.4 26 3/9/2024
6.0.0-preview.2.21154.6 23 3/9/2024
6.0.0-preview.1.21102.12 23 3/9/2024
5.0.0 32 4/12/2022
5.0.0-rc.2.20475.5 28 3/9/2024
5.0.0-rc.1.20451.14 25 3/9/2024
5.0.0-preview.8.20407.11 23 3/9/2024
5.0.0-preview.7.20364.11 26 3/9/2024
5.0.0-preview.6.20305.6 31 3/9/2024
5.0.0-preview.5.20278.1 23 3/9/2024
5.0.0-preview.4.20251.6 21 3/9/2024
5.0.0-preview.3.20215.2 23 3/9/2024
5.0.0-preview.2.20160.3 23 3/9/2024
5.0.0-preview.1.20120.4 25 3/9/2024
3.1.32 30 3/9/2024
3.1.31 25 3/9/2024
3.1.30 32 3/9/2024
3.1.29 26 3/9/2024
3.1.28 25 3/9/2024
3.1.27 29 3/9/2024
3.1.26 27 3/9/2024
3.1.25 30 3/9/2024
3.1.24 29 3/9/2024
3.1.23 30 3/9/2024
3.1.22 29 3/9/2024
3.1.21 30 3/9/2024
3.1.20 30 3/9/2024
3.1.19 27 3/9/2024
3.1.18 25 3/9/2024
3.1.17 37 3/9/2024
3.1.16 29 3/9/2024
3.1.15 32 3/9/2024
3.1.14 28 3/9/2024
3.1.13 28 3/9/2024
3.1.12 24 3/9/2024
3.1.11 28 3/9/2024
3.1.10 29 3/9/2024
3.1.9 28 3/9/2024
3.1.8 30 3/9/2024
3.1.7 28 3/9/2024
3.1.6 28 3/9/2024
3.1.5 33 3/9/2024
3.1.4 27 3/9/2024
3.1.3 32 3/9/2024
3.1.2 31 3/9/2024
3.1.1 28 3/9/2024
3.1.0 28 3/9/2024
3.1.0-preview3.19553.2 30 3/9/2024
3.1.0-preview2.19525.4 27 3/9/2024
3.1.0-preview1.19506.1 24 3/9/2024
3.0.3 28 3/9/2024
3.0.2 32 3/9/2024
3.0.1 30 3/9/2024
3.0.0 25 3/9/2024
3.0.0-rc1.19456.10 26 3/9/2024
3.0.0-preview9.19423.4 22 3/9/2024
3.0.0-preview8.19405.4 34 3/9/2024
3.0.0-preview7.19362.4 25 3/9/2024
3.0.0-preview6.19304.6 23 3/9/2024
3.0.0-preview5.19227.9 22 3/9/2024
3.0.0-preview4.19216.2 27 3/9/2024
3.0.0-preview3.19153.1 24 3/9/2024
3.0.0-preview.19074.2 26 3/9/2024
3.0.0-preview.18572.1 24 3/9/2024
2.2.0 31 4/12/2022
2.2.0-preview3-35497 23 3/9/2024
2.2.0-preview2-35157 20 3/9/2024
2.2.0-preview1-35029 23 3/9/2024
2.1.1 30 3/9/2024
2.1.0 25 2/27/2024
2.1.0-rc1-final 27 3/9/2024
2.1.0-preview2-final 25 3/9/2024
2.1.0-preview1-final 31 3/9/2024
2.0.1 28 3/9/2024
2.0.0 30 3/9/2024
2.0.0-preview2-final 29 3/9/2024
2.0.0-preview1-final 23 3/9/2024
1.1.1 26 3/9/2024
1.1.0 34 3/9/2024
1.1.0-preview1-final 29 3/9/2024
1.0.1 27 3/9/2024
1.0.0 26 3/9/2024
1.0.0-rc2-final 28 3/9/2024