ITempFileSystemService Methods
Interface Methods 2 members
Service for managing temporary directories and files within Aspire.
Creates a new temporary file and returns it.
public interface ITempFileSystemService{ public abstract TempFile CreateTempFile( string? fileName = null) { // ... }}Parameters
fileName string? optional Optional file name for the temporary file (e.g., "config.json", "script.sh"). If null, uses a random name. Remarks
This method creates a new temporary file. If a file name is specified, it creates a temporary subdirectory and places the file with that name inside it. If no file name is specified, it uses Path.GetTempFileName. Dispose the returned object to delete the file.
Use this instead of calling Path.GetTempFileName directly.
CreateTempSubdirectory(string?) Section titled CreateTempSubdirectory(string?) abstract TempDirectory Creates and returns a temporary subdirectory.
public interface ITempFileSystemService{ public abstract TempDirectory CreateTempSubdirectory( string? prefix = null) { // ... }}Parameters
prefix string? optional Optional prefix for the subdirectory name (e.g., "aspire"). Returns
TempDirectory A TempDirectory representing the created temporary subdirectory. Dispose to delete. Remarks
This method creates a unique temporary subdirectory using the system temp folder. The directory is created immediately. Dispose the returned object to delete the directory.
Use this instead of calling Directory.CreateTempSubdirectory directly.