.NetCore 在WindowsService 下获取目录结果
LogHelper.LogDebug($"Directory.GetCurrentDirectory: {Directory.GetCurrentDirectory()}");
LogHelper.LogDebug($"AppDomain.CurrentDomain.BaseDirectory: {AppDomain.CurrentDomain.BaseDirectory}");
LogHelper.LogDebug($"Environment.CurrentDirectory: {Environment.CurrentDirectory}");
输出如下:
Directory.GetCurrentDirectory: C:\Windows\system32
AppDomain.CurrentDomain.BaseDirectory: D:\A1_workdir\WorkerService\bin\Release\net8.0\publish\win-x64\
Environment.CurrentDirectory: C:\Windows\system32
网友评论