I am reading files on .NET Framework like this:
string path = AppDomain.CurrentDomain.BaseDirectory + @"sources\settings.json";
string jsonResult = File.ReadAllText(path);
return JsonConvert.DeserializeObject<Settings>(jsonResult);
When I switch to .NET5 this only works on Debug mode. When I create a Single File Executable
using Publish it is not running. When U click the Exe it never open or throws an exception. Also, try-catch
block couldn't handle the exception.
How can I make this work on .NET5 Single Exe files?