PhysicalFileProvider.UsePollingFileWatcher 屬性

定義

取得或設定值,這個值可判斷此 PhysicalFileProvider 執行個體是否會使用輪詢來判定檔案變更。

根據預設,PhysicalFileProvider 會使用 FileSystemWatcher,來為 Watch(String) 接聽檔案變更事件。 FileSystemWatcher 在某些狀況下 (例如掛接的磁碟機) 不正確。 需要輪詢才能有效地監看檔案變更。

public:
 property bool UsePollingFileWatcher { bool get(); void set(bool value); };
public bool UsePollingFileWatcher { get; set; }
member this.UsePollingFileWatcher : bool with get, set
Public Property UsePollingFileWatcher As Boolean

屬性值

此屬性的預設值取決於名為 DOTNET_USE_POLLING_FILE_WATCHER的環境變數值。 當 或 1true,這個屬性預設為 ,否則falsetrue

適用於

另請參閱