.net core 单文件发布,找不到appsettings.json的问题
解决方案
builder.Configuration.SetBasePath(Path.GetDirectoryName(Process.GetCurrentProcess().MainModule?.FileName));
builder.Configuration.AddJsonFile("appsettings.json", optional: true, reloadOnChange: true);
解决方案
builder.Configuration.SetBasePath(Path.GetDirectoryName(Process.GetCurrentProcess().MainModule?.FileName));
builder.Configuration.AddJsonFile("appsettings.json", optional: true, reloadOnChange: true);