IngvarX/Camelot

Missing appsettings.json after clean git clone

Closed this issue · 2 comments

If you simply clone the repository and execute:

git clone https://github.com/ingvar1995/Camelot.git
cd Camelot
dotnet restore
dotnet build
dotnet run --project src/Camelot/Camelot.csproj

IT will result in a FileNotFoundException

Unhandled exception. System.IO.FileNotFoundException: The configuration file 'appsettings.json' was not found and is not optional

If however you

cd src/Camelot
dotnet run

there is no Exception.

Info:

  • Commit: 3acd8a6
  • OS: Ubuntu 20.04
  • .NET Core Version: 3.1.201

Possible fix:

---
 src/Camelot/Bootstrapper.cs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/Camelot/Bootstrapper.cs b/src/Camelot/Bootstrapper.cs
index 8c25452..36f430d 100644
--- a/src/Camelot/Bootstrapper.cs
+++ b/src/Camelot/Bootstrapper.cs
@@ -48,7 +48,7 @@ namespace Camelot
         {
             var configuration = new ConfigurationBuilder()
                 .SetBasePath(Directory.GetCurrentDirectory())
-                .AddJsonFile("appsettings.json")
+                .AddJsonFile("appsettings.json", true)
                 .Build();
             
             var aboutDialogConfiguration = new AboutDialogConfiguration();
-- 

Fixed in 84b4993. Seems that app used wrong directory for both appsettings and database file.