NewLifeX/NewLife.Agent

示例的写法有问题,需要提前设置Environment.CurrentDirectory

Closed this issue · 1 comments

这个文件中的写法有点问题,https://github.com/NewLifeX/NewLife.Agent/blob/master/TestWorker/Program.cs。

`
// 一定在CreateDefaultBuilder之前,设置Environment.CurrentDirectory,否则在window服务启动时,IHostEvironment中的ContentRoot就是C:\Windows\system32

Environment.CurrentDirectory = ".".GetFullPath();

var host = Host.CreateDefaultBuilder(args)
...
`

nnhy commented

嗯,可以提交个PR