Microsoft.Extensions.FileProviders.Physical
                               
                            
                                9.0.10
                            
                        
                            
                                
                                
                                    Prefix Reserved
                                
                            
                    See the version list below for details.
dotnet add package Microsoft.Extensions.FileProviders.Physical --version 9.0.10
NuGet\Install-Package Microsoft.Extensions.FileProviders.Physical -Version 9.0.10
<PackageReference Include="Microsoft.Extensions.FileProviders.Physical" Version="9.0.10" />
<PackageVersion Include="Microsoft.Extensions.FileProviders.Physical" Version="9.0.10" />
<PackageReference Include="Microsoft.Extensions.FileProviders.Physical" />
paket add Microsoft.Extensions.FileProviders.Physical --version 9.0.10
#r "nuget: Microsoft.Extensions.FileProviders.Physical, 9.0.10"
#:package Microsoft.Extensions.FileProviders.Physical@9.0.10
#addin nuget:?package=Microsoft.Extensions.FileProviders.Physical&version=9.0.10
#tool nuget:?package=Microsoft.Extensions.FileProviders.Physical&version=9.0.10
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 
FileSystemWatcheror 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.PhysicalFileProviderMicrosoft.Extensions.FileProviders.PhysicalDirectoryInfoMicrosoft.Extensions.FileProviders.PhysicalFileInfo
Additional Documentation
Related Packages
- Abstractions of files and directories: Microsoft.Extensions.FileProviders.Abstractions
 - File system globbing to find files matching a specified pattern: Microsoft.Extensions.FileSystemGlobbing
 
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.
| Product | Versions Compatible and additional computed target framework versions. | 
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. | 
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. | 
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. | 
| .NET Framework | net461 was computed. net462 is compatible. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. | 
| MonoAndroid | monoandroid was computed. | 
| MonoMac | monomac was computed. | 
| MonoTouch | monotouch was computed. | 
| Tizen | tizen40 was computed. tizen60 was computed. | 
| Xamarin.iOS | xamarinios was computed. | 
| Xamarin.Mac | xamarinmac was computed. | 
| Xamarin.TVOS | xamarintvos was computed. | 
| Xamarin.WatchOS | xamarinwatchos was computed. | 
- 
                                                    
.NETFramework 4.6.2
- Microsoft.Extensions.FileProviders.Abstractions (>= 9.0.10)
 - Microsoft.Extensions.FileSystemGlobbing (>= 9.0.10)
 - Microsoft.Extensions.Primitives (>= 9.0.10)
 
 - 
                                                    
.NETStandard 2.0
- Microsoft.Extensions.FileProviders.Abstractions (>= 9.0.10)
 - Microsoft.Extensions.FileSystemGlobbing (>= 9.0.10)
 - Microsoft.Extensions.Primitives (>= 9.0.10)
 
 - 
                                                    
net8.0
- Microsoft.Extensions.FileProviders.Abstractions (>= 9.0.10)
 - Microsoft.Extensions.FileSystemGlobbing (>= 9.0.10)
 - Microsoft.Extensions.Primitives (>= 9.0.10)
 
 - 
                                                    
net9.0
- Microsoft.Extensions.FileProviders.Abstractions (>= 9.0.10)
 - Microsoft.Extensions.FileSystemGlobbing (>= 9.0.10)
 - Microsoft.Extensions.Primitives (>= 9.0.10)
 
 
NuGet packages (495)
Showing the top 5 NuGet packages that depend on Microsoft.Extensions.FileProviders.Physical:
| Package | Downloads | 
|---|---|
| 
                                                        
                                                            Microsoft.Extensions.Configuration.FileExtensions
                                                        
                                                            
                                                         Provides a base class for file-based configuration providers used with Microsoft.Extensions.Configuration and extension methods for configuring them.  | 
                                                    |
| 
                                                        
                                                            Microsoft.Extensions.Configuration.UserSecrets
                                                        
                                                            
                                                         User secrets configuration provider implementation for Microsoft.Extensions.Configuration. User secrets mechanism enables you to override application configuration settings with values stored in the local secrets file. You can use UserSecretsConfigurationExtensions.AddUserSecrets extension method on IConfigurationBuilder to add user secrets provider to the configuration builder.  | 
                                                    |
| 
                                                        
                                                            Microsoft.Extensions.Hosting
                                                        
                                                            
                                                         Hosting and startup infrastructures for applications.  | 
                                                    |
| 
                                                        
                                                            Microsoft.AspNetCore.Hosting
                                                        
                                                            
                                                         ASP.NET Core hosting infrastructure and startup logic for web applications.  | 
                                                    |
| 
                                                        
                                                            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  | 
                                                    
GitHub repositories (89)
Showing the top 20 popular GitHub repositories that depend on Microsoft.Extensions.FileProviders.Physical:
| Repository | Stars | 
|---|---|
| 
                                                        
                                                            microsoft/semantic-kernel
                                                        
                                                         
                                                            Integrate cutting-edge LLM technology quickly and easily into your apps
                                                         
                                                     | 
                                                    |
| 
                                                        
                                                            BeyondDimension/SteamTools
                                                        
                                                         
                                                            🛠「Watt Toolkit」是一个开源跨平台的多功能 Steam 工具箱。
                                                         
                                                     | 
                                                    |
| 
                                                        
                                                            abpframework/abp
                                                        
                                                         
                                                            Open-source web application framework for ASP.NET Core! Offers an opinionated architecture to build enterprise software solutions with best practices on top of the .NET. Provides the fundamental infrastructure, cross-cutting-concern implementations, startup templates, application modules, UI themes, tooling and documentation.
                                                         
                                                     | 
                                                    |
| 
                                                        
                                                            chocolatey/choco
                                                        
                                                         
                                                            Chocolatey - the package manager for Windows
                                                         
                                                     | 
                                                    |
| 
                                                        
                                                            JeffreySu/WeiXinMPSDK
                                                        
                                                         
                                                            微信全平台 .NET SDK, Senparc.Weixin for C#,支持 .NET Framework 及 .NET Core、.NET 10.0。已支持微信公众号、小程序、小游戏、微信支付、企业微信/企业号、开放平台、JSSDK、微信周边等全平台。 WeChat SDK for C#.
                                                         
                                                     | 
                                                    |
| 
                                                        
                                                            RayWangQvQ/BiliBiliToolPro
                                                        
                                                         
                                                            B 站(bilibili)自动任务工具,支持docker、青龙、k8s等多种部署方式。敏感肌也能用。
                                                         
                                                     | 
                                                    |
| 
                                                        
                                                            umbraco/Umbraco-CMS
                                                        
                                                         
                                                            Umbraco is a free and open source .NET content management system helping you deliver delightful digital experiences.
                                                         
                                                     | 
                                                    |
| 
                                                        
                                                            microsurging/surging
                                                        
                                                         
                                                            Surging is a micro-service engine that provides a lightweight, high-performance, modular RPC request pipeline.  support Event-based Asynchronous Pattern and reactive programming ,The service engine supports http, TCP, WS,Grpc, Thrift,Mqtt, UDP, and DNS protocols. It uses ZooKeeper and Consul as a registry, and integrates it. Hash, random, polling, Fair Polling as a load balancing algorithm, built-in service governance to ensure reliable RPC communication, the engine contains Diagnostic, link tracking for protocol and middleware calls, and integration SkyWalking Distributed APM
                                                         
                                                     | 
                                                    |
| 
                                                        
                                                            lukencode/FluentEmail
                                                        
                                                         
                                                            All in one email sender for .NET. Supports popular senders (SendGrid, MailGun, etc) and Razor templates.
                                                         
                                                     | 
                                                    |
| 
                                                        
                                                            aspnet/JavaScriptServices
                                                        
                                                         
                                                            [Archived] This repository has been archived
                                                         
                                                     | 
                                                    |
| 
                                                        
                                                            Arcenox-co/TickerQ
                                                        
                                                         
                                                            TickerQ is a fast, reflection-free background task scheduler for .NET — built with source generators, EF Core integration, cron + time-based execution, and a real-time dashboard.
                                                         
                                                     | 
                                                    |
| 
                                                        
                                                            1357310795/MyComputerManager
                                                        
                                                         
                                                            管理“此电脑”里删不掉的流氓“快捷方式”(包括侧边栏),同时可自己添加这类“快捷方式”
                                                         
                                                     | 
                                                    |
| 
                                                        
                                                            reactjs/React.NET
                                                        
                                                         
                                                            .NET library for JSX compilation and server-side rendering of React components
                                                         
                                                     | 
                                                    |
| 
                                                        
                                                            OmniSharp/omnisharp-roslyn
                                                        
                                                         
                                                            OmniSharp server (HTTP, STDIO) based on Roslyn workspaces
                                                         
                                                     | 
                                                    |
| 
                                                        
                                                            microsoft/PowerApps-Samples
                                                        
                                                         
                                                            Sample code for Power Apps, including Dataverse, model-driven apps, canvas apps, Power Apps component framework, portals, and AI Builder.
                                                         
                                                     | 
                                                    |
| 
                                                        
                                                            statiqdev/Statiq.Web
                                                        
                                                         
                                                            Statiq Web is a flexible static site generator written in .NET.
                                                         
                                                     | 
                                                    |
| 
                                                        
                                                            toddams/RazorLight
                                                        
                                                         
                                                            Template engine based on Microsoft's Razor parsing engine for .NET Core
                                                         
                                                     | 
                                                    |
| 
                                                        
                                                            cloudscribe/cloudscribe
                                                        
                                                         
                                                            ASP.NET Core multi-tenant web application foundation with management for sites, users, roles, claims and more 
                                                         
                                                     | 
                                                    |
| 
                                                        
                                                            tmoonlight/NSmartProxy
                                                        
                                                         
                                                            NSmartProxy是一款开源的内网穿透工具。采用.NET CORE的全异步模式打造。(NSmartProxy is an open source reverse proxy tool that creates a secure tunnel from a public endpoint to a locally service.)
                                                         
                                                     | 
                                                    |
| 
                                                        
                                                            MarimerLLC/csla
                                                        
                                                         
                                                            A home for your business logic in any .NET application.
                                                         
                                                     | 
                                                    
| Version | Downloads | Last Updated | |
|---|---|---|---|
| 10.0.0-rc.2.25502.107 | 72,308 | 10/14/2025 | |
| 10.0.0-rc.1.25451.107 | 173,537 | 9/9/2025 | |
| 10.0.0-preview.7.25380.108 | 54,655 | 8/12/2025 | |
| 10.0.0-preview.6.25358.103 | 57,099 | 7/15/2025 | |
| 10.0.0-preview.5.25277.114 | 70,884 | 6/6/2025 | |
| 10.0.0-preview.4.25258.110 | 41,644 | 5/12/2025 | |
| 10.0.0-preview.3.25171.5 | 86,341 | 4/10/2025 | |
| 10.0.0-preview.2.25163.2 | 46,246 | 3/18/2025 | |
| 10.0.0-preview.1.25080.5 | 81,496 | 2/25/2025 | |
| 9.0.10 | 1,732,561 | 10/14/2025 | |
| 9.0.9 | 5,806,359 | 9/9/2025 | |
| 9.0.8 | 7,091,763 | 8/4/2025 | |
| 9.0.7 | 6,072,137 | 7/8/2025 | |
| 9.0.6 | 7,080,810 | 6/10/2025 | |
| 9.0.5 | 8,911,714 | 5/13/2025 | |
| 9.0.4 | 13,079,191 | 4/8/2025 | |
| 9.0.3 | 9,836,874 | 3/11/2025 | |
| 9.0.2 | 10,417,033 | 2/11/2025 | |
| 9.0.1 | 10,583,544 | 1/14/2025 | |
| 9.0.0 | 29,175,874 | 11/12/2024 | |
| 9.0.0-rc.2.24473.5 | 211,201 | 10/8/2024 | |
| 9.0.0-rc.1.24431.7 | 144,543 | 9/10/2024 | |
| 9.0.0-preview.7.24405.7 | 117,553 | 8/13/2024 | |
| 9.0.0-preview.6.24327.7 | 120,904 | 7/9/2024 | |
| 9.0.0-preview.5.24306.7 | 86,322 | 6/11/2024 | |
| 9.0.0-preview.4.24266.19 | 160,119 | 5/21/2024 | |
| 9.0.0-preview.3.24172.9 | 170,931 | 4/11/2024 | |
| 9.0.0-preview.2.24128.5 | 94,732 | 3/12/2024 | |
| 9.0.0-preview.1.24080.9 | 111,164 | 2/13/2024 | |
| 8.0.0 | 293,328,974 | 11/14/2023 | |
| 8.0.0-rc.2.23479.6 | 356,373 | 10/10/2023 | |
| 8.0.0-rc.1.23419.4 | 433,004 | 9/12/2023 | |
| 8.0.0-preview.7.23375.6 | 164,213 | 8/8/2023 | |
| 8.0.0-preview.6.23329.7 | 138,145 | 7/11/2023 | |
| 8.0.0-preview.5.23280.8 | 186,976 | 6/13/2023 | |
| 8.0.0-preview.4.23259.5 | 367,274 | 5/16/2023 | |
| 8.0.0-preview.3.23174.8 | 257,388 | 4/11/2023 | |
| 8.0.0-preview.2.23128.3 | 89,506 | 3/14/2023 | |
| 8.0.0-preview.1.23110.8 | 175,705 | 2/21/2023 | |
| 7.0.0 | 150,390,372 | 11/7/2022 | |
| 7.0.0-rc.2.22472.3 | 237,770 | 10/11/2022 | |
| 7.0.0-rc.1.22426.10 | 180,750 | 9/14/2022 | |
| 7.0.0-preview.7.22375.6 | 220,155 | 8/9/2022 | |
| 7.0.0-preview.6.22324.4 | 119,941 | 7/12/2022 | |
| 7.0.0-preview.5.22301.12 | 78,944 | 6/14/2022 | |
| 7.0.0-preview.4.22229.4 | 122,775 | 5/10/2022 | |
| 7.0.0-preview.3.22175.4 | 73,483 | 4/13/2022 | |
| 7.0.0-preview.2.22152.2 | 67,299 | 3/14/2022 | |
| 7.0.0-preview.1.22076.8 | 53,388 | 2/17/2022 | |
| 6.0.1 | 2,206,411 | 11/12/2024 | |
| 6.0.0 | 347,284,635 | 11/8/2021 | |
| 6.0.0-rc.2.21480.5 | 583,766 | 10/12/2021 | |
| 6.0.0-rc.1.21451.13 | 395,496 | 9/14/2021 | |
| 6.0.0-preview.7.21377.19 | 226,256 | 8/10/2021 | |
| 6.0.0-preview.6.21352.12 | 136,823 | 7/14/2021 | |
| 6.0.0-preview.5.21301.5 | 83,909 | 6/15/2021 | |
| 6.0.0-preview.4.21253.7 | 66,620 | 5/24/2021 | |
| 6.0.0-preview.3.21201.4 | 229,626 | 4/8/2021 | |
| 6.0.0-preview.2.21154.6 | 139,560 | 3/11/2021 | |
| 6.0.0-preview.1.21102.12 | 160,763 | 2/12/2021 | |
| 5.0.0 | 224,460,189 | 11/9/2020 | |
| 5.0.0-rc.2.20475.5 | 289,155 | 10/13/2020 | |
| 5.0.0-rc.1.20451.14 | 355,480 | 9/14/2020 | |
| 5.0.0-preview.8.20407.11 | 78,805 | 8/25/2020 | |
| 5.0.0-preview.7.20364.11 | 143,342 | 7/21/2020 | |
| 5.0.0-preview.6.20305.6 | 63,445 | 6/25/2020 | |
| 5.0.0-preview.5.20278.1 | 414,599 | 6/10/2020 | |
| 5.0.0-preview.4.20251.6 | 132,474 | 5/18/2020 | |
| 5.0.0-preview.3.20215.2 | 52,612 | 4/23/2020 | |
| 5.0.0-preview.2.20160.3 | 129,071 | 4/2/2020 | |
| 5.0.0-preview.1.20120.4 | 62,390 | 3/16/2020 | |
| 3.1.32 | 4,598,958 | 12/13/2022 | |
| 3.1.31 | 1,318,404 | 11/8/2022 | |
| 3.1.30 | 2,068,091 | 10/11/2022 | |
| 3.1.29 | 1,369,535 | 9/13/2022 | |
| 3.1.28 | 751,206 | 8/9/2022 | |
| 3.1.27 | 675,572 | 7/12/2022 | |
| 3.1.26 | 616,138 | 6/14/2022 | |
| 3.1.25 | 1,065,078 | 5/10/2022 | |
| 3.1.24 | 14,742,522 | 4/11/2022 | |
| 3.1.23 | 3,262,864 | 3/8/2022 | |
| 3.1.22 | 16,591,255 | 12/14/2021 | |
| 3.1.21 | 4,855,725 | 11/7/2021 | |
| 3.1.20 | 2,357,106 | 10/11/2021 | |
| 3.1.19 | 2,182,280 | 9/14/2021 | |
| 3.1.18 | 4,163,482 | 8/10/2021 | |
| 3.1.17 | 3,465,871 | 7/13/2021 | |
| 3.1.16 | 3,959,121 | 6/8/2021 | |
| 3.1.15 | 4,506,753 | 5/11/2021 | |
| 3.1.14 | 6,554,523 | 4/6/2021 | |
| 3.1.13 | 7,371,495 | 3/9/2021 | |
| 3.1.12 | 5,097,010 | 2/9/2021 | |
| 3.1.11 | 6,963,705 | 1/12/2021 | |
| 3.1.10 | 14,847,440 | 11/9/2020 | |
| 3.1.9 | 17,341,562 | 10/13/2020 | |
| 3.1.8 | 22,578,740 | 9/8/2020 | |
| 3.1.7 | 15,333,779 | 8/11/2020 | |
| 3.1.6 | 24,909,156 | 7/14/2020 | |
| 3.1.5 | 25,726,625 | 6/9/2020 | |
| 3.1.4 | 16,342,678 | 5/12/2020 | |
| 3.1.3 | 28,110,468 | 3/24/2020 | |
| 3.1.2 | 22,431,941 | 2/18/2020 | |
| 3.1.1 | 18,189,193 | 1/14/2020 | |
| 3.1.0 | 213,283,473 | 12/3/2019 | |
| 3.1.0-preview3.19553.2 | 99,299 | 11/13/2019 | |
| 3.1.0-preview2.19525.4 | 21,221 | 11/1/2019 | |
| 3.1.0-preview1.19506.1 | 49,942 | 10/15/2019 | |
| 3.0.3 | 793,694 | 2/18/2020 | |
| 3.0.2 | 862,546 | 1/14/2020 | |
| 3.0.1 | 3,114,254 | 11/18/2019 | |
| 3.0.0 | 34,122,980 | 9/23/2019 | |
| 3.0.0-rc1.19456.10 | 46,514 | 9/16/2019 | |
| 3.0.0-preview9.19423.4 | 264,962 | 9/4/2019 | |
| 3.0.0-preview8.19405.4 | 268,571 | 8/13/2019 | |
| 3.0.0-preview7.19362.4 | 234,946 | 7/23/2019 | |
| 3.0.0-preview6.19304.6 | 627,526 | 6/12/2019 | |
| 3.0.0-preview5.19227.9 | 237,576 | 5/6/2019 | |
| 3.0.0-preview4.19216.2 | 39,898 | 4/18/2019 | |
| 3.0.0-preview3.19153.1 | 211,612 | 3/6/2019 | |
| 3.0.0-preview.19074.2 | 139,014 | 1/29/2019 | |
| 3.0.0-preview.18572.1 | 53,630 | 12/4/2018 | |
| 2.2.0 | 242,859,765 | 12/3/2018 | |
| 2.2.0-preview3-35497 | 305,342 | 10/17/2018 | |
| 2.2.0-preview2-35157 | 160,377 | 9/12/2018 | |
| 2.2.0-preview1-35029 | 85,361 | 8/22/2018 | |
| 2.1.1 | 318,967,210 | 6/18/2018 | |
| 2.1.0 | 303,980,164 | 5/29/2018 | |
| 2.1.0-rc1-final | 327,789 | 5/6/2018 | |
| 2.1.0-preview2-final | 447,297 | 4/10/2018 | |
| 2.1.0-preview1-final | 1,830,723 | 2/26/2018 | |
| 2.0.1 | 40,831,412 | 3/13/2018 | |
| 2.0.0 | 97,945,805 | 8/11/2017 | |
| 2.0.0-preview2-final | 546,980 | 6/28/2017 | |
| 2.0.0-preview1-final | 199,152 | 5/10/2017 | |
| 1.1.1 | 23,796,023 | 5/9/2017 | |
| 1.1.0 | 16,191,848 | 11/16/2016 | |
| 1.1.0-preview1-final | 70,506 | 10/24/2016 | |
| 1.0.1 | 96,297,131 | 12/12/2016 | |
| 1.0.0 | 22,047,007 | 6/27/2016 | |
| 1.0.0-rc2-final | 1,902,188 | 5/16/2016 |