@@ -5,10 +5,10 @@ This document tracks the implementation of IFileSystemService across the Aspire
55## Completed Tasks
66
77### Core API
8- - ✅ Created ` src/Aspire.Hosting/Utils/IFileSystemService.cs ` with adjusted API
9- - Renamed ` GetTempFileName ` → ` CreateTempFile(string? extension = null) `
10- - Added overload ` CreateTempFile (string prefix, string fileName) `
11- - Improved XML documentation with clarity about parent directory disposal
8+ - ✅ Created ` src/Aspire.Hosting/Utils/IFileSystemService.cs ` with simplified API
9+ - Single ` CreateTempFile() ` method with no parameters for creating temp files
10+ - ` CreateTempSubdirectory (string? prefix = null) ` for creating temp directories
11+ - Simplified XML documentation
1212- ✅ Created ` src/Aspire.Hosting/Utils/FileSystemService.cs ` implementation
1313- ✅ Updated ` src/Aspire.Hosting/IDistributedApplicationBuilder.cs `
1414 - Added FileSystemService property
@@ -125,20 +125,17 @@ var directoryService = builder.ApplicationBuilder.FileSystemService;
125125### 3. Replace temp file/directory APIs
126126``` csharp
127127// OLD: Path.GetTempFileName()
128- // NEW: directoryService.TempDirectory.CreateTempFile("prefix", "filename.ext" ).Path
128+ // NEW: directoryService.TempDirectory.CreateTempFile().Path
129129
130130// OLD: Directory.CreateTempSubdirectory("prefix")
131131// NEW: directoryService.TempDirectory.CreateTempSubdirectory("prefix").Path
132-
133- // For random temp file with specific extension:
134- // directoryService.TempDirectory.CreateTempFile(".json").Path
135132```
136133
137134## Key Adjustments from Original PR #13244
138135
139- 1 . ✅ ** Renamed API** : ` GetTempFileName(extension? )` → ` CreateTempFile(extension?) `
136+ 1 . ✅ ** Simplified API** : ` CreateTempFile( )` with no parameters - simple temp file creation
1401372 . ✅ ** Removed Documentation** : Removed references to ASPIRE_TEMP_FOLDER and Aspire: TempDirectory configuration
141- 3 . ✅ ** Improved Docs ** : Added clarity about parent directory disposal in TempFile XML docs
138+ 3 . ✅ ** Simplified Implementation ** : Removed complex overloads and parent directory deletion logic
1421394 . ⏳ ** Line Numbers** : Need to fix line numbers in docs/temp-folder-inventory.md tables
1431405 . ⏳ ** Tests** : Need to create comprehensive FileSystemServiceTests.cs
144141
@@ -156,6 +153,6 @@ Before finalizing, ensure:
156153## Notes
157154
158155- The pattern of extracting ` .Path ` and not disposing is ** intentional** - many temp files/dirs persist for app lifetime
159- - When using ` CreateTempFile(prefix, fileName) ` , the parent directory is auto-deleted on Dispose
160- - When using ` CreateTempFile(extension) ` , only the file is deleted (no parent dir cleanup)
156+ - ` CreateTempFile() ` creates a simple temp file, caller is responsible for cleanup if needed
157+ - ` CreateTempSubdirectory(prefix) ` creates a temp directory that can be disposed to clean up
161158- All APIs are marked ` [Experimental("ASPIREFILESYSTEM001")] `
0 commit comments