【发布时间】:2021-08-10 04:22:50
【问题描述】:
我想执行以下操作,但我希望能够将应用程序移动到任何位置,并且文件 client_secrets.json 将始终位于同一文件夹中。该语句应从根 (d:) 调用。有没有办法在(工作)文件夹中指定开始?
d:\> dotnet D:\projects\Test\Test.GoogleSheets\bin\Debug\netcoreapp3.1\Test.GoogleSheets.dll
Unhandled exception. System.IO.FileNotFoundException: Could not find file 'D:\client_secret.json'.
File name: 'D:\client_secret.json'
at System.IO.FileStream.ValidateFileHandle(SafeFileHandle fileHandle)
at System.IO.FileStream.CreateFileOpenHandle(FileMode mode, FileShare share, FileOptions options)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access)
at Test.GoogleSheets.Program.Main(String[] args) in D:\projects\Test\Test.GoogleSheets\Program.cs:line 33
【问题讨论】:
标签: c# batch-file cmd