Export (0) Print
Expand All

TempFileCollection.KeepFiles Property

Gets or sets a value indicating whether to keep the files, by default, when the Delete method is called or the collection is disposed.

Namespace:  System.CodeDom.Compiler
Assembly:  System (in System.dll)

public bool KeepFiles { get; set; }

Property Value

Type: System.Boolean
true if the files should be kept; otherwise, false.

The value of the KeepFiles property is used as the default value when the AddExtension overload that does not have a keepFile parameter is called to add a temporary file to the collection. Each temporary file in the collection has an associated keep file flag that determines, on a per-file basis, whether that file is to be kept or deleted. Files are automatically kept or deleted on completion of the compilation based on their associated keep files value. However, after compilation is complete, files that were kept can be released by setting KeepFiles false and calling the Delete method. This will result in all files being deleted.

.NET Framework

Supported in: 4.5.3, 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

© 2014 Microsoft