DirectoryEntry.UsePropertyCache Property


Gets or sets a value indicating whether the cache should be committed after each operation.

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

Property Value


true if the cache should not be committed after each operation; otherwise, false. The default is true.



By default, changes to properties are made locally to a cache, and property values to be read are cached after the first read. When the UsePropertyCache property is true, access to the DirectoryEntry object's properties is faster. Setting this to false will cause the cache to be committed after each operation.

If the UsePropertyCache property is true and you want to commit cached changes, call the CommitChanges method. To update values in the cache after changes to the directory are made, call the RefreshCache method.


If you call RefreshCache before calling CommitChanges, any uncommitted changes to the property cache will be lost.


The Internet Information Services (IIS) provider does not support committing the cache after each operation.

Applies to

See also