From 7d1163c68f6a54c2d295037fe8c6c87b0b0e3490 Mon Sep 17 00:00:00 2001 From: Jason Dove Date: Tue, 11 Jan 2022 15:36:12 -0600 Subject: [PATCH] fix double-click startup on mac (#570) --- CHANGELOG.md | 2 ++ ErsatzTV/Program.cs | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9e40d18fc..8a9c71e99 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,8 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ## [Unreleased] +### Fixed +- Fix double-click startup on mac ## [0.3.6-alpha] - 2022-01-10 ### Fixed diff --git a/ErsatzTV/Program.cs b/ErsatzTV/Program.cs index 8d36ad3a0..670a86a8d 100644 --- a/ErsatzTV/Program.cs +++ b/ErsatzTV/Program.cs @@ -1,5 +1,6 @@ using System; using System.IO; +using System.Reflection; using System.Threading.Tasks; using ErsatzTV.Core; using Microsoft.AspNetCore.Hosting; @@ -12,7 +13,7 @@ namespace ErsatzTV public class Program { private static IConfiguration Configuration { get; } = new ConfigurationBuilder() - .SetBasePath(Directory.GetCurrentDirectory()) + .SetBasePath(Path.GetDirectoryName(Assembly.GetEntryAssembly().Location)) .AddJsonFile("appsettings.json", false, true) .AddJsonFile( $"appsettings.{Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT") ?? "Production"}.json",