aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/slskd/Program.cs9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/slskd/Program.cs b/src/slskd/Program.cs
index 373cad67..7095a716 100644
--- a/src/slskd/Program.cs
+++ b/src/slskd/Program.cs
@@ -1,4 +1,4 @@
-namespace slskd
+namespace slskd
{
using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Hosting;
@@ -22,6 +22,8 @@
{
public static IConfigurationBuilder AddConfigurationProviders(this IConfigurationBuilder builder, string environmentVariablePrefix, string configurationFile)
{
+ configurationFile = Path.GetFullPath(configurationFile);
+
return builder
.AddDefaultValues(
map: Options.Map.Select(o => o.ToDefaultValue()))
@@ -29,9 +31,10 @@
prefix: environmentVariablePrefix,
map: Options.Map.Select(o => o.ToEnvironmentVariable()))
.AddYamlFile(
- path: Path.Combine(AppContext.BaseDirectory, configurationFile),
+ path: Path.GetFileName(configurationFile),
optional: true,
- reloadOnChange: false)
+ reloadOnChange: false,
+ provider: new PhysicalFileProvider(Path.GetDirectoryName(configurationFile), ExclusionFilters.None))
.AddCommandLine(
commandLine: Environment.CommandLine,
map: Options.Map.Select(o => o.ToCommandLineArgument()));