Visual Basic (Declaration) | |
---|---|
Public Shared Property TempPath As String |
C# | |
---|---|
public static string TempPath {get; set;} |
Any data created by the runtime deployment which is temporary and does not need to be persisted between application sessions will be written to the folder specified by this property for the lifetime of your application. To override the default, the property must be set each time your application starts but before the Initialize method is called. Once the runtime deployment is initialized, any attempt to set this property will result in a Exception. To ensure the files in the folder specified by this property will be automatically deleted you should call the ShutdownAsync method on the LocalServer. However, if any problems are encountered during execution some files may be left in this folder. These are not essential to future usage of the runtime deployment and can safely be deleted during the shutdown phase of you application.
The default value for this property is:
- "C:\Users\{UserName}\AppData\Local\Temp" (Windows 7, Windows Vista and Windows Server 2008).
- "C:\Documents and Settings\{UserName}\Local Settings\Temp" (Windows XP and Windows Server 2003).
This property, in conjunction with the AppDataPath property, enables you to have control over any application-related or temporary data created by the runtime deployment during use by your application and can help achieve a zero footprint implementation in which no files are left behind when the application is removed from or uninstalled from the deployment machine.
Property Value
A System.String representing the path to a folder on disk.Target Platforms: Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family, Windows 7, Windows 8