real-zony / ZonyLrcToolsX

ZonyLrcToolsX 是一个能够方便地下载歌词的小软件。
MIT License
1.46k stars 117 forks source link

OSX中不放在"~/"路径下就无法运行 #125

Closed xingzhili2007 closed 1 year ago

xingzhili2007 commented 1 year ago

只有放在个人根目录"/Users/abc(用户名)/"下才可以运行

abc@localhost ~ % /Users/abc/mybin/ZonyLrcTools/ZonyLrcTools.Cli 
Unhandled exception. System.IO.DirectoryNotFoundException: Could not find a part of the path '/Users/abc/Resources/error_msg.json'.
   at Interop.ThrowExceptionForIoErrno(ErrorInfo errorInfo, String path, Boolean isDirError)
   at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String path, OpenFlags flags, Int32 mode, Func`4 createOpenException)
   at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, UnixFileMode openPermissions, Int64& fileLength, UnixFileMode& filePermissions, Func`4 createOpenException)
   at System.IO.Strategies.OSFileStreamStrategy..ctor(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable`1 unixCreateMode)
   at System.IO.StreamReader.ValidateArgsAndOpenPath(String path, Encoding encoding, Int32 bufferSize)
   at System.IO.File.OpenText(String path)
   at ZonyLrcTools.Common.Infrastructure.Exceptions.ErrorCodeHelper.LoadErrorMessage() in /home/runner/work/ZonyLrcToolsX/ZonyLrcToolsX/src/ZonyLrcTools.Common/Infrastructure/Exceptions/ErrorCodeHelper.cs:line 29
   at ZonyLrcTools.Cli.Program.ConfigureErrorMessage() in /home/runner/work/ZonyLrcToolsX/ZonyLrcToolsX/src/ZonyLrcTools.Cli/Program.cs:line 50
   at ZonyLrcTools.Cli.Program.Main(String[] args) in /home/runner/work/ZonyLrcToolsX/ZonyLrcToolsX/src/ZonyLrcTools.Cli/Program.cs:line 32
   at ZonyLrcTools.Cli.Program.<Main>(String[] args)
zsh: abort      /Users/abc/mybin/ZonyLrcTools/ZonyLrcTools.Cli
real-zony commented 1 year ago

请确保程序同目录有 'Resources/error_msg.json' 文件。