check for existence of appsettings.json on Maui
This commit is contained in:
@ -63,6 +63,8 @@ public static class MauiProgram
|
|||||||
private static void LoadAppSettings()
|
private static void LoadAppSettings()
|
||||||
{
|
{
|
||||||
string file = Path.Combine(FileSystem.Current.AppDataDirectory, "appsettings.json");
|
string file = Path.Combine(FileSystem.Current.AppDataDirectory, "appsettings.json");
|
||||||
|
if (File.Exists(file))
|
||||||
|
{
|
||||||
using FileStream stream = File.OpenRead(file);
|
using FileStream stream = File.OpenRead(file);
|
||||||
using StreamReader reader = new StreamReader(stream);
|
using StreamReader reader = new StreamReader(stream);
|
||||||
var content = reader.ReadToEnd();
|
var content = reader.ReadToEnd();
|
||||||
@ -72,6 +74,7 @@ public static class MauiProgram
|
|||||||
url = (string)obj["Url"];
|
url = (string)obj["Url"];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private static void LoadClientAssemblies(HttpClient http)
|
private static void LoadClientAssemblies(HttpClient http)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user