fix: Fixed the path issue #128.

We should avoid using the Directory.GetCurrentDirectory() method, as it
can result in retrieving incorrect paths.
This commit is contained in:
real-zony
2023-03-19 11:28:04 +08:00
parent 286731b1a6
commit 572e555f2a
6 changed files with 9 additions and 8 deletions

View File

@@ -1,4 +1,5 @@
using System.Collections.Generic;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
@@ -20,7 +21,7 @@ namespace ZonyLrcTools.Tests.Infrastructure.Album
albumBytes.Length.ShouldBeGreaterThan(0);
// 显示具体的图像。
var tempAlbumPath = Path.Combine(Directory.GetCurrentDirectory(), "tempAlbum.png");
var tempAlbumPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "tempAlbum.png");
File.Delete(tempAlbumPath);
await using var file = File.Create(tempAlbumPath);